るりまサーチ

最速Rubyリファレンスマニュアル検索!
71件ヒット [1-71件を表示] (0.123秒)
トップページ > クエリ:i[x] > クエリ:class[x] > クエリ:Raise[x] > クエリ:bind[x]

別のキーワード

  1. argf.class lines
  2. argf.class each_line
  3. argf.class each
  4. class new
  5. argf.class readline

検索結果

UnboundMethod#bind(obj) -> Method (24255.0)

self を obj にバインドした Method オブジェクトを生成して返します。

...みです。

@raise TypeError objがbindできないオブジェクトである場合に発生します

//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class
Foo
def foo
"foo"
end
end

# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo...
...スをレシーバとする Method オブジェクトを生成
p m.bind(Foo.new) # => #<Method: Foo#foo>

# Foo のサブクラス Bar のインスタンスをレシーバとする Method
class
Bar < Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>


# モジュー...
...# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: Foo#foo>

# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class
Bar
i
nclude Foo
end
p m.bind(Bar.new) # => #<Method:...
...instance_method(:foo) # => #<UnboundMethod: Foo#foo>

# Foo をインクルードしたクラス Bar のインスタンスをレシーバと
# する Method オブジェクトを生成
class
Bar
i
nclude Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>
//}

@see UnboundMethod#bi...

Tracer.add_filter {|event, file, line, id, binding, klass| .... } (6312.0)

トレース出力するかどうかを決定するフィルタを追加します。 何もフィルタを与えない場合はすべての行についてトレース情報が出力されます。 与えられた手続き(ブロックまたはProcオブジェクト)が真を返せば トレースは出力されます。

...を指定します。
通常、true か falseを返す必要があります。

フィルタ手続きは引数として event, file, line, id, binding, klass の
6 つをとります。
Kernel.#set_trace_func で指定するものとほぼ同じです。

=== フィルタ手続きのパ...
...力での表記。

//emlist{
* line (-) ある行を実行
* call (>) メソッド呼び出し
* return (<) メソッドからのリターン
* class (C) クラスコンテキストに入った
* end (E) クラスコンテキストから出た
* raise 例外が発生した...
...ッドからreturn
//}

: file
現在処理しているファイルの名前

: line
現在処理している行番号

: id
最後に呼び出されたメソッドのメソッド名(のシンボル)
そのようなメソッドがなければ0になる。

: binding
現在のコンテキ...

Module#instance_method(name) -> UnboundMethod (6118.0)

self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

...tring で指定します。

@raise NameError self に存在しないメソッドを指定した場合に発生します。

@see Module#public_instance_method, Object#method

//emlist[例][ruby]{
class
Interpreter
def do_a() print "there, "; end
def do_d() print "Hello "; end
def do_e() prin...
..._v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end

i
nterpreter = Interpr...
...eter.new
i
nterpreter.interpret('dave')
# => Hello there, Dave!
//}...

ruby 1.6 feature (1344.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...by 1.6.7 (2002-03-29) [i586-linux]
"ruby-1.6\000-v\000-"

: 2002-03-22 ((<Module/module_eval>))

((<Module/module_eval>)) のブロック内で定数やクラス変数のスコープが
変わることはなくなりました。((<ruby-dev:17876>))

class
Foo
FOO = 1...
...Exception
Numeric
MatchData
Segmentation fault

=> ruby 1.6.5 (2001-10-15) [i586-linux]
MatchData
NotImplementedError
FloatDomainError
LoadError
Float
Bind
ing
SignalException...

1.6.8から1.8.0への変更点(まとめ) (840.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...の変更点(まとめ)/Windows 対応>))
* ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>))
* ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>))
* ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>))
* ((<1.6.8から1.8.0...
...nil の指定(-W0)を可能にします。

: ruby interpreter [ruby] [change]

クラスの特異クラスの特異クラスは特異クラス自身であると定義されました
((<ruby-bugs-ja:313>))。なんだかよくわかりません(^^;

class
<< Object
p [self.id,...
...ータス [compat]

raise
SystemExit したときに終了ステータス 1 で終了するようになりました。
((<ruby-dev:16776>))

: ((<"rescue/ensure on begin .. end while"|制御構造/while 修飾子>)) [compat]

rescue/ensure を持つ begin 式も while/until 修飾できるよ...

絞り込み条件を変える

ruby 1.8.4 feature (192.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影...
...boundMethod#bind [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>)...
...r): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.

: super [bug]

Kernelのメソッド内でsuperを呼んだ時に、存在しないsuperclass
にアクセスし...

NEWS for Ruby 2.7.0 (96.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ルか bugs.ruby-lang.org の issue を参照してください。

== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

* パターンマッチが実験的機能として導入されました。 14912

//emlist[][ruby]{
case [0, [1, 2, 3]]
i
n [a, [b, *c]]
p a #=> 0...
...#joinで参照した時も警告が出ます。
この警告は「-W:no-deprecated」オプションで止められます。

* ヒアドキュメントの識別子の引用符は同じ行で閉じる必要があります。

//emlist{
<<"EOS
" # This had been warned since 2.4; Now it raises a...
...(raise rescue [1, 2])
//}

* 特異クラス構文での yield は警告を表示するようになりました。
これは deprecated です。 15575
この警告は「-W:no-deprecated」オプションで止められます。

//emlist{
def foo
class
<< Object.new
yield #=> warnin...