42件ヒット
[1-42件を表示]
(0.283秒)
種類
- インスタンスメソッド (22)
- 文書 (20)
ライブラリ
- ビルトイン (22)
クラス
- Object (22)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9)
検索結果
先頭4件
-
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (18120.0) -
self に特異メソッド name を定義します。
...ethod Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:wh......o_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (18120.0) -
self に特異メソッド name を定義します。
...ethod Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:wh......o_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
NEWS for Ruby 2
. 3 . 0 (54.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...#fetch_values を追加
10017
* Hash#dig を追加
11643
* Hash#<=, Hash#<, Hash#>=, Hash#> を追加
10984
* Hash#to_proc を追加
11653
* IO
* 新しいフラグ File::SHARE_DELETE(File::Constants::SHARE_DELETE) が使用できます。
Windows で......NameError#receiver を追加
10881
* Numeric
* Numeric#positive?, Numeric#negative? を追加
11151
* Proc
* Proc#call ( Proc#[] , Proc#===, Proc#yield) は最適化されました。
Backtrace doesn't show each method (show block lines directly).
TracePoint al......あると例外が発生するようになりました。
11444
* Module
* Module#define_method と Object#define_singleton_method は
メソッド本体(Procオブジェクト、Methodオブジェクト、またはブロック )が必須になりました。
ブロックが... -
NEWS for Ruby 2
. 1 . 0 (30.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...とができます。
* Process
* 追加: Process.#argv0 オリジナルの $0 の値を返します。
* 追加: Process.#setproctitle $0 に影響を与えずにプロセス名をセットできます。
* 追加: Process.#clock_gettime
* 追加: Process.#clock_getres
* Strin......。
The ancestors of a singleton class now include singleton classes,
in particular itself.
* Module#define_method Object#define_singleton_method
* 定義したメソッドの名前をシンボルで返すようになりました。メソッドオブジェクトではありませ......はなく TypeError を発生させるようになりました。
* Proc
* Returning from lambda proc now always exits from the Proc, not from the
method where the lambda is created. Returning from non-lambda proc exits
from the method, same as the former behavior.
* String...