別のキーワード
種類
- 文書 (31)
- インスタンスメソッド (22)
- モジュール (6)
クラス
- Object (22)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
Profiler
_ _ (6) - method (11)
- クラス/メソッドの定義 (11)
検索結果
先頭5件
-
Object
# singleton _ method(name) -> Method (18119.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
...o.new(99)
def k.hi
"Hi, @iv = #{@iv}"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method... -
NEWS for Ruby 2
. 1 . 0 (42.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ンボルを返すためにキーワード引数 `exception: false` を受け付けるようになりました
* Kernel
* 追加: Kernel#singleton_method(Object#singleton_method)
* Module
* 追加: Module#using, which activates refinements of the specified module only
in the curr......O
* 非互換: IO.open は外部エンコーディングが ASCII-8BIT のとき内部エンコーディングを無視します。
* Kernel.#eval, Kernel.#instance_eval, Module#module_eval
元の環境のスコープ情報をコピーするようになりました。これは、引数な......The ancestors of a singleton class now include singleton classes,
in particular itself.
* Module#define_method Object#define_singleton_method
* 定義したメソッドの名前をシンボルで返すようになりました。メソッドオブジェクトではありません... -
クラス/メソッドの定義 (34.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
.../メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined
===[a:class] クラス定義
//emlist[......タを定義する方法の一つです。イテレータを定義する代表的な方法は
yield を呼び出すことです。
他に Proc.new/Kernel.#proc を使う方法などもあります。
ブロックが与えられなかった場合のブロック引数の値はnilです。
//emlist[......foo は未定義
def foo
print "foo\n"
end
//}
は未定義メソッドの呼び出しで例外 NameError を発生させます。
===[a:singleton_method] 特異メソッド定義
//emlist[例][ruby]{
def foo.test
print "this is foo\n"
end
//}
文法:
def 式 `.' 識別子 [`(' [... -
Profiler
_ _ (24.0) -
プロファイラの実装です。 Profiler__.start_profile 実行から、Profiler__.stop_profile までの 区間の実行コードのプロファイルを取得します。
...self total
time seconds seconds calls ms/call ms/call name
51.64 1.10 1.10 3 366.67 776.67 Kernel.require
17.37 1.47 0.37 1 370.00 370.00 TclTkIp#initialize
8.92 1.66 0.19 514 0.37 0.37 Modu......profile
4.23 1.89 0.09 15 6.00 10.67 Kernel.extend
3.29 1.96 0.07 15 4.67 4.67 Module#extend_object
3.29 2.03 0.07 133 0.53 0.53 Kernel.singleton_method_added
2.82 2.09 0.06 28 2.14 2.86... -
NEWS for Ruby 2
. 3 . 0 (18.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...OSYS を起こしません。
サポートの有無を実行時ではなくビルド時に検出するためです。
11806
* Kernel
* Kernel.#loop は StopIteration で停止したときに nil ではなく最後に評価した要素を返します。
11498
* Module......全な文字があると例外が発生するようになりました。
11444
* Module
* Module#define_method と Object#define_singleton_method は
メソッド本体(Procオブジェクト、Methodオブジェクト、またはブロック )が必須になりました。... -
Object
# method(name) -> Method (12.0) -
オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。
...ror 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#abs>
p me.call #=> 365
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method...