別のキーワード
種類
- インスタンスメソッド (60)
- 文書 (29)
- ライブラリ (24)
- クラス (12)
クラス
- BasicObject (12)
- Delegator (12)
- Object (12)
- WIN32OLE (12)
-
WIN32OLE
_ EVENT (12)
キーワード
- BasicObject (12)
-
NEWS for Ruby 3
. 0 . 0 (5) - handler= (12)
-
respond
_ to _ missing? (12) -
rexml
/ parsers / sax2parser (12) -
rexml
/ parsers / streamparser (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12)
検索結果
先頭5件
-
BasicObject
# method _ missing(name , *args) -> object (18214.0) -
呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。
...数です。
@return ユーザー定義の method_missing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。
//emlist[例][ruby]{
class Foo
def initialize(data)
@data = data
end
def method_missing(name, lang)
if name.to_s =~ /\Afind_... -
WIN32OLE
# method _ missing(id , *args) -> object | nil (18214.0) -
WIN32OLE#invokeメソッドを実行します。
...WIN32OLEはOLEオートメーションオブジェクトのメソッド呼び出しを
method_missingを利用して実行します。このためWIN32OLEを継承するクラスを
作成してmethod_missingをオーバーライドする場合、superを呼び出してくださ
い。
@see WIN32... -
Delegator
# method _ missing(m , *args) -> object (18208.0) -
渡されたメソッド名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。
...名と引数を使って、Delegator#__getobj__ が返すオブジェクトへメソッド委譲を行います。
@param m メソッドの名前(シンボル)
@param args メソッドに渡された引数
@return 委譲先のメソッドからの返り値
@see BasicObject#method_missing... -
NEWS for Ruby 3
. 0 . 0 (1686.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...照してください。
== 言語仕様の変更
* Keyword 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......{
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(meth, ...)......send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in` is changed to return `true` or `fals... -
ruby 1
. 8 . 4 feature (1116.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...feature
ruby 1.8.4 での ruby 1.8.3 からの変更点です。
掲載方針
*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。
以下は......))
# * カテゴリ
# * [ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互......', 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
# information.
:... -
ruby 1
. 6 feature (90.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...=> ruby 1.6.7 (2002-07-30) [i586-linux]
"0"
: 2002-05-23 -* オプション(?)
以前まで、
#! ruby -*- mode: ruby -*-
のような Emacs の '-*-' 指定を使用したスクリプトのために -* 以降を無
視する(何もしないオプションとして認識)......の特別扱いはなくなりました。Emacs の '-*-' 指定は、2行目に書くように
するべきです。((<ruby-dev:17193>))
ruby '-*' -v
=> ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby: invalid option -* (-h will show valid options)
: 2002-05-22 parsedate......[i586-linux]
"**+"
"\001+"
"\001\000"
"\001+\000"
"*+\000"
=> ruby 1.6.5 (2001-11-01) [i586-linux]
"**+"
"+"
"\001\000"
"+\000"
"*+\000"
: method_missing
以下が Segmentation... -
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (46.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
...ソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。
Object#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。
BasicObject#method_missing を override した場合に......t[例][ruby]{
class Sample
def method_missing(name, *args)
if name =~ /^to_*/
[name, *args] # => [:to_sample, "sample args1", "sample args2"]
return
else
super
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... -
BasicObject (24.0)
-
特殊な用途のために意図的にほとんど何も定義されていないクラスです。 Objectクラスの親にあたります。Ruby 1.9 以降で導入されました。
...スを定義する際には Object クラスは持っているメソッドが多すぎる
場合があります。
例えば、 BasicObject#method_missingを利用して Proxy パターンを実
装する場合にはObject クラスに定義済みのメソッドはプロクシできないという......合にだけ BasicObject から派生してください。
=== 例
//emlist[例][ruby]{
class Proxy < BasicObject
def initialize(target)
@target = target
end
def method_missing(message, *args)
@target.__send__(message, *args)
end
end
proxy = Proxy.new("1")
proxy.to_i #=> 1
//}... -
WIN32OLE
_ EVENT # handler=(obj) -> () (18.0) -
イベント処理を実行するオブジェクトを登録します。
...ンドラはイベント名に「on」を前置します。もし、イベントに対応
するonメソッドが実装されていなければmethod_missingが呼ばれます。イベン
ト名は大文字小文字を区別するため、正確な記述が必要です。
@param obj イベントに......isp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@completed = true
end
def method_missing(id, *args)
puts "event=#{id.to_s}, args=#{args.inspect}"
end
end
ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WI...