569件ヒット
[1-100件を表示]
(0.054秒)
ライブラリ
- English (12)
- ビルトイン (330)
- fiddle (12)
- json (12)
- monitor (12)
- observer (12)
-
rexml
/ document (24) - set (18)
-
webrick
/ httpresponse (12) - win32ole (12)
クラス
-
ARGF
. class (36) - BasicObject (12)
- FalseClass (24)
- Method (24)
- Module (36)
- NilClass (12)
- Object (48)
-
REXML
:: CData (24) - Range (12)
- Thread (24)
-
Thread
:: Backtrace :: Location (24) - TrueClass (12)
- UnboundMethod (12)
-
WEBrick
:: HTTPResponse (12) -
WIN32OLE
_ EVENT (12)
モジュール
- Enumerable (24)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (36)
キーワード
-
$ ERROR _ INFO (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Closure (12)
- Location (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - Numeric (12)
- Observable (12)
- String (12)
-
add
_ trace _ func (12) -
define
_ singleton _ method (24) - handler= (12)
-
http
_ version (12) - inspect (60)
- irb (12)
-
irb
/ completion (12) -
method
_ missing (12) - name (12)
- new (12)
- owner (12)
-
rb
_ class _ path (12) -
ruby 1
. 6 feature (12) -
set
_ trace _ func (24) -
to
_ json (12) -
to
_ set (24) -
to
_ str (12) - tracer (12)
- value (12)
- write (12)
- メソッド呼び出し(super・ブロック付き・yield) (10)
検索結果
先頭5件
-
NilClass
# to _ s -> String (21107.0) -
空文字列 "" を返します。
...空文字列 "" を返します。
//emlist[例][ruby]{
nil.to_s # => ""
//}... -
TrueClass
# to _ s -> String (21107.0) -
常に文字列 "true" を返します。
...常に文字列 "true" を返します。
//emlist[例][ruby]{
true.to_s # => "true"
//}... -
Object
# to _ s -> String (18131.0) -
オブジェクトの文字列表現を返します。
...使って文字列に変換し
ます。
//emlist[][ruby]{
class Foo
def initialize num
@num = num
end
end
it = Foo.new(40)
puts it #=> #<Foo:0x2b69110>
class Foo
def to_s
"Class:Foo Number:#{@num}"
end
end
puts it #=> Class:Foo Number:40
//}
@see Object#to_str,Kernel.#String... -
REXML
:: CData # to _ s -> String (18113.0) -
テキスト文字列を返します。
...テキスト文字列を返します。
@see REXML::Text#value, REXML::Text#to_s
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}... -
Thread
:: Backtrace :: Location # to _ s -> String (18113.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...した文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `ne... -
FalseClass
# to _ s -> String (18107.0) -
常に文字列 "false" を返します。
...常に文字列 "false" を返します。
//emlist[例][ruby]{
false.to_s # => "false"
//}... -
ARGF
. class # to _ s -> String (18101.0) -
常に文字列 "ARGF" を返します。
常に文字列 "ARGF" を返します。 -
Module
# to _ s -> String (15137.0) -
モジュールやクラスの名前を文字列で返します。
...#=> "A::B"
class C
end
end
p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"
# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b09112c8>"
p Class.new.to_s #=> "#<Class:0x00007fa5... -
Method
# to _ s -> String (15131.0) -
self を読みやすい文字列として返します。
...るクラス/モジュール名、
method は、メソッド名を表します。
//emlist[例][ruby]{
module Foo
def foo
"foo"
end
end
class Bar
include Foo
def bar
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo>
p Bar.new.method(:bar) # => #<Method: Bar#......ド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo>
# クラスメソッド(クラスの特異メソッド)
class Foo
def Foo.foo
end
end
p Foo.method(:foo) # => #<Method: Foo.foo>
# スーパークラスのクラスメソッド
class Bar < Foo
end......p Bar.method(:foo) # => #<Method: Bar.foo>
# 以下は(形式1)の出力になる
module Baz
def baz
end
end
class <<obj
include Baz
end
p obj.method(:baz) # => #<Method: Object(Baz)#baz>
//}
@see Object#inspect......ocation を表します。
source_location が nil の場合には付きません。
//emlist[例][ruby]{
module Foo
def foo
"foo"
end
end
class Bar
include Foo
def bar(a, b)
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo() test.rb:2>
p Bar.new.method(:bar)......""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo() foo.rb:4>
# クラスメソッド(クラスの特異メソッド)
class Foo
def Foo.foo
end
end
p Foo.method(:foo) # => #<Method: Foo.foo() foo.rb:11>
# スーパークラスのクラスメソッド
class B......ar < Foo
end
p Bar.method(:foo) # => #<Method: Bar(Foo).foo() foo.rb:11>
# 以下は(形式1)の出力になる
module Baz
def baz
end
end
class <<obj
include Baz
end
p obj.method(:baz) # => #<Method: String(Baz)#baz() foo.rb:23>
//}
@see Object#inspect...