るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.095秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

Method#inspect -> String (18144.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) #...
...式では klass1 はレシーバ、
klass2 は実際にそのメソッドを定義しているオブジェクトになります。

//emlist[例][ruby]{
# オブジェクトの特異メソッド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo>

# クラスメ...
...の文字列を返します。

#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)

klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。

klass2...
...Method#source_location を表します。
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.meth...
...式では klass1 はレシーバ、
klass2 は実際にそのメソッドを定義しているオブジェクトになります。

//emlist[例][ruby]{
# オブジェクトの特異メソッド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo() foo.rb:4>

# ク...

Method#to_s -> String (3044.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) #...
...式では klass1 はレシーバ、
klass2 は実際にそのメソッドを定義しているオブジェクトになります。

//emlist[例][ruby]{
# オブジェクトの特異メソッド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo>

# クラスメ...
...の文字列を返します。

#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)

klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。

klass2...
...Method#source_location を表します。
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.meth...
...式では klass1 はレシーバ、
klass2 は実際にそのメソッドを定義しているオブジェクトになります。

//emlist[例][ruby]{
# オブジェクトの特異メソッド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo() foo.rb:4>

# ク...