104件ヒット
[101-104件を表示]
(0.064秒)
ライブラリ
- ビルトイン (91)
-
minitest
/ unit (1) -
rdoc
/ context (12)
クラス
- Binding (7)
- Exception (12)
- Method (12)
-
MiniTest
:: Unit (1) - Module (12)
- Proc (12)
-
RDoc
:: Context (12) -
Thread
:: Backtrace :: Location (36)
キーワード
-
absolute
_ path (12) -
backtrace
_ locations (12) -
const
_ source _ location (12) - inspect (18)
- path (12)
-
record
_ location (12) -
source
_ location (19) -
to
_ s (6)
検索結果
-
Method
# to _ s -> String (3049.0) -
self を読みやすい文字列として返します。
...の文字列を返します。
#<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.metho......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 Bar < Foo
end
p Bar.metho...