るりまサーチ

最速Rubyリファレンスマニュアル検索!
37件ヒット [1-37件を表示] (0.188秒)
トップページ > クエリ:I[x] > クエリ:a[x] > クエリ:find[x] > クエリ:method_missing[x]

別のキーワード

  1. matrix find_index
  2. _builtin find_index
  3. find find
  4. pathname find
  5. array find_index

ライブラリ

クラス

検索結果

BasicObject#method_missing(name, *args) -> object (27325.0)

呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。

...ッドの名前 (Symbol) が name に
その時の引数が第二引数以降に渡されます。

デフォルトではこのメソッドは例外 NoMethodError を発生させます。


@param name 未定義メソッドの名前(シンボル)です。
@param args 未定義メソッドに渡...
...義の method_missing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。

//emlist[例][ruby]{
class Foo
def initialize(data)
@data = data
end
def method_missing(name, lang)
i
f name.to_s =~ /\Afind_(\d+)_in\z/
i
f @data[lang]...
...p @data[lang][$1.to_i]
else
raise "#{lang} unknown"
end
else
super
end
end
end

dic = Foo.new({:English => %w(zero one two), :Esperanto => %w(nulo unu du)})
dic.find_2_in :Esperanto #=> "du"
//}

[注意] このメソッドを override する場合は対象...

ruby 1.6 feature (4416.0)

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

...ature
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) -> stable-sna...
...warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i586-linux]
"\\#"
nil

: 2002-04-29: rb_find_file()

$SAF...
...[i586-linux]
"**+"
"\001+"
"\001\000"
"\001+\000"
"*+\000"

=> ruby 1.6.5 (2001-11-01) [i586-linux]
"**+"
"+"
"\001\000"
"+\000"
"*+\000"

: method_missing

以下が Segmentation...

ruby 1.8.4 feature (3312.0)

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

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

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。...
...
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影...
...feature/添付ライブラリ>))
* ((<ruby 1.8.4 feature/"Ruby/Tk">))
* ((<ruby 1.8.4 feature/REXML [compat]>))
* ((<ruby 1.8.4 feature/TCPSocket#initialize [bug]>))
* ((<ruby 1.8.4 feature/TCPServer#initialize [bug]>))
* ((<ruby 1.8.4 feature/"optparse">))
* ((<ruby 1.8.4 feature/"find"...

NEWS for Ruby 3.0.0 (486.0)

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

...word arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now match...
...list[][ruby]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(...
...d. It can be used like a rightward assignment.
17260
* `in` is changed to return `true` or `false`. 17371

//emlist{
0 => a
p a #=> 0

{b: 0, c: 1} => {b:}
p b #=> 0
//}

//emlist{
# version 3.0
0 in 1 #=> false

# version 2.7
0 in 1 #=> raise NoMatchingPatternError
//}

* Find-pat...