るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.107秒)
トップページ > クエリ:t[x] > クエリ:method[x] > クエリ:module_exec[x]

別のキーワード

  1. _builtin define_method
  2. irb/input-method new
  3. irb/input-method gets
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

ライブラリ

クラス

キーワード

検索結果

Module#module_exec(*args) {|*vars| ... } -> object (15225.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

...す。


//emlist[例][ruby]{
class Thing
end
c = 1

T
hing.class_exec{
def hello()
"Hello there!"
end

define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end
}

t
= Thing.new
p t.hello() #=> "Hello there!"
p t.foo()...

ruby 1.9 feature (3060.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...ruby 1.9 feature
ruby version 1.9.0 は開発版です。
以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。
1.9.1 以降は安定版です。
バグ修正がメインになります。

記号について(特に重要なもの...
...by_identity?
: Hash#identical
: Hash#identical?

=== 2006-09-12

: Hash#compare_by_identity
: Hash#compare_by_identity?

=== 2006-09-11

: Hash#identical
: Hash#identical?

=== 2006-08-31

: Array#shuffle
: Array#shuffle!

追加

=== 2006-07-26

: __send
: __send!

追加

: invoke_method
: inv...
...[obsolete]
: chop [obsolete]
: chop! [obsolete]
: chomp [obsolete]
: chomp! [obsolete]
: split [obsolete]
: scan [obsolete]

削除

=== 2005-10-21
: funcall [new]

fcall から改名

: Module#instance_exec [new]
: Module#module_exec [n...

Module#class_exec(*args) {|*vars| ... } -> object (125.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

...す。


//emlist[例][ruby]{
class Thing
end
c = 1

T
hing.class_exec{
def hello()
"Hello there!"
end

define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end
}

t
= Thing.new
p t.hello() #=> "Hello there!"
p t.foo()...