329件ヒット
[1-100件を表示]
(0.038秒)
種類
- インスタンスメソッド (176)
- 文書 (98)
- ライブラリ (44)
- クラス (11)
クラス
-
ARGF
. class (22) - FalseClass (22)
- Method (22)
- Module (44)
- Object (33)
-
Thread
:: Backtrace :: Location (11) - TrueClass (11)
-
WIN32OLE
_ EVENT (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) - Numeric (11)
- cgi (11)
-
const
_ missing (11) -
drb
/ gw (11) - handler= (11)
-
initialize
_ copy (11) - irb (11)
-
irb
/ completion (11) - name (11)
-
pretty
_ print (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
to
_ s (44) - クラス/メソッドの定義 (11)
検索結果
先頭5件
-
TrueClass
# inspect -> String (21107.0) -
常に文字列 "true" を返します。
...常に文字列 "true" を返します。
//emlist[例][ruby]{
true.inspect # => "true"
//}... -
ARGF
. class # inspect -> String (21101.0) -
常に文字列 "ARGF" を返します。
常に文字列 "ARGF" を返します。 -
FalseClass
# inspect -> String (21101.0) -
常に文字列 "false" を返します。
常に文字列 "false" を返します。
//emlist[例][ruby]{
false.to_s # => "false"
//} -
Method
# inspect -> String (18149.0) -
self を読みやすい文字列として返します。
...式の文字列を返します。
#<Method: klass1(klass2)#method> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。
klass2......るクラス/モジュール名、
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......の文字列を返します。
#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。
klass2......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... -
Object
# inspect -> String (18143.0) -
オブジェクトを人間が読める形式に変換した文字列を返します。
...して
オブジェクトを表示します。
//emlist[][ruby]{
[ 1, 2, 3..4, 'five' ].inspect # => "[1, 2, 3..4, \"five\"]"
Time.new.inspect # => "2008-03-08 19:43:39 +0900"
//}
inspect メソッドをオーバーライドしなかった場合、クラス名とインスタン......変数の名前、値の組を元にした文字列を返します。
//emlist[][ruby]{
class Foo
end
Foo.new.inspect # => "#<Foo:0x0300c868>"
class Bar
def initialize
@bar = 1
end
end
Bar.new.inspect # => "#<Bar:0x0300c868 @bar=1>"
//}
@see Kernel.#p... -
Module
# inspect -> String (18125.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... -
Thread
:: Backtrace :: Location # inspect -> String (18113.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...ブジェクトを返します。
//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.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:i... -
ARGF
. class # to _ s -> String (6001.0) -
常に文字列 "ARGF" を返します。
常に文字列 "ARGF" を返します。 -
FalseClass
# to _ s -> String (6001.0) -
常に文字列 "false" を返します。
常に文字列 "false" を返します。
//emlist[例][ruby]{
false.to_s # => "false"
//} -
Method
# to _ s -> String (3049.0) -
self を読みやすい文字列として返します。
...の文字列を返します。
#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。
klass2......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...