るりまサーチ

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

別のキーワード

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

検索結果

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

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

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

呼び出しに失敗したメソッドの名前 (Symbol) が name に
その時の引数が第二引数以降に渡されます。

デフォルトではこのメソッドは例外 NoMethodError を発...
...数です。
@return ユーザー定義の method_missing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。

//emlist[例][ruby]{
class Foo
def initialize(data)
@data = data
end
def method_missing(name, lang)
if name.to_s =~ /\Afind_...

Object#respond_to_missing?(symbol, include_private) -> bool (157.0)

自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。

... symbol で表されるメソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。

Object#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。

BasicObject#method_missing...
...de されるべきです。

false を返します。

@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます

//emlist[例][ruby]{
class Sample
def method_missing(name, *args)
if name =~ /^to_*/
[name, *args] # =>...
...end
end

def respond_to_missing?(sym, include_private)
(sym =~ /^to_*/) ? true : super
end
end

s = Sample.new
s.to_sample("sample args1", "sample args2")
s.respond_to?(:to_sample) # => true
s.respond_to?(:sample) # => false
//}

@see Object#respond_to?, BasicObject#method_missing...

ruby 1.8.4 feature (102.0)

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

...latform]: 対応プラットフォームの追加

== 目次

* ((<ruby 1.8.4 feature/Ruby本体>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/super [bug]>))
* ((<ruby 1.8.4 feature/正規表現 [bug]>))
* ((<ruby 1.8.4 feature/...
...re/Sun [bug]>))
* ((<ruby 1.8.4 feature/IA64 [bug]>))

== Ruby本体

: Symbol [bug]

# * parse.y (dsym): prohibit empty symbol literal by interpolation.
# fixed: [ruby-talk:166529]

式展開で空のSymbolを作ることができたバグの修正。 ((<ruby-talk:166529>))...
...pected '(', expecting $end

#Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# inform...

NEWS for Ruby 3.0.0 (36.0)

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

...}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

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

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern mat...
...Module#attr_reader, Module#attr_writer and Module#attr methods now return an array of defined method names as symbols. 17314
* Module#alias_method now returns the defined alias as a symbol. 17314

//emlist[][ruby]{
class C; end
module M1; end
module M2; end
C.include M1
M1.include M2
p C.ancesto...
...* String#swapcase
* String#tr
* String#tr_s
* String#upcase
* Symbol
* Symbol#to_proc now returns a lambda Proc. 16260
* Symbol#name has been added, which returns the name of the symbol if it is named. The returned string is frozen. 16150
* Fiber
* Introduce F...

rexml/parsers/sax2parser (18.0)

SAX2 と同等の API を持つストリーム式の XML パーサ。

...ED xyz CDATA "foobar">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
<root xmlns="http://example.org/default"
xmlns:foo="http://example.org/foo"
xmlns:b...
...att='2' att='&lt;'>
<bar:b />
</a>
&amp;&amp; <!-- comment here--> &bar;
</root>
EOS

class Listener
#include REXML::SAX2Listener
def method_missing(name, *args)
p [name, *args]
end
def respond_to_missing?(name, include_private)
name != :call
end
end

parser = REXML::Parsers:...
...iondecl, "foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]
# >> [:progress, 683]
# >> [:entitydecl, "HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES Symbols for XHTML//EN", "xhtml-symbol.ent", "%"]
# >> [:progress, 683]
# >> [:progress, 683]
# >> [:progress, 683]
# >> [:characters, "\n"]
# >> [:pro...

絞り込み条件を変える

rexml/parsers/streamparser (18.0)

ストリーム式の XML パーサ。

...ED xyz CDATA "foobar">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar"><![CDATA[cdat...
...a is here]]>
<a foo:att='1' bar:att='2' att='&lt;'/>
&amp;&amp; <!-- comment here--> &bar;
</root>
EOS

class Listener
def method_missing(name, *args)
p [name, *args]
end
def respond_to_missing?(sym, include_private)
true
end
end

REXML::Parsers::StreamParser.new(xml, Listener.ne...
...r\">"]
# >> [:notationdecl, ["foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]]
# >> [:entitydecl, ["HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES Symbols for XHTML//EN", "xhtml-symbol.ent", "%"]]
# >> [:doctype_end]
# >> [:text, "\n"]
# >> [:tag_start, "root", {"xmlns:foo"=>"http://example.org/f...