るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.103秒)
トップページ > バージョン:2.5.0[x] > クエリ:l[x] > クエリ:v[x] > クラス:BasicObject[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

キーワード

検索結果

BasicObject#instance_eval(expr, filename = "(eval)", lineno = 1) -> object (36904.0)

オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。

...ソッドが定義されます。これはメソッド定義のネストと同じです。
d:spec/def#nest_method を参照してください。

BasicObject
を継承して作ったクラス内で instance_eval する場合はトップレベルの定数や Kernel モジュールに定義されて...
...imeError)
//}

//emlist[例][ruby]{
class Bar < BasicObject
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end

bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}

@see Module#module_eval, Kernel.#eval, BasicObject#instance_exec...

BasicObject#instance_eval {|obj| ... } -> object (36604.0)

オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。

...ソッドが定義されます。これはメソッド定義のネストと同じです。
d:spec/def#nest_method を参照してください。

BasicObject
を継承して作ったクラス内で instance_eval する場合はトップレベルの定数や Kernel モジュールに定義されて...
...imeError)
//}

//emlist[例][ruby]{
class Bar < BasicObject
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end

bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}

@see Module#module_eval, Kernel.#eval, BasicObject#instance_exec...

BasicObject#singleton_method_removed(name) -> object (36604.0)

特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。

...method_removed(name)
puts "singleton method \"#{name}\" was removed"
end
end

obj = Foo.new
def obj.foo
end

class << obj
remove_method :foo
end

#=> singleton method "foo" was removed
//}

@see Module#method_removed,BasicObject#singleton_method_added,BasicObject#singleton_method_undefined...