るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.041秒)

別のキーワード

  1. _builtin puts
  2. csv puts
  3. stringio puts
  4. xmp puts
  5. io puts

ライブラリ

クラス

キーワード

検索結果

WIN32OLE_EVENT#on_event(event = nil) {|*args| ... } -> () (18245.0)

イベント通知を受けるブロックを登録します。

...イベントのメソッ
ド名が文字列で与えられます。引数の変更が必要な場合は、
WIN32OLE_EVENT#on_event_with_outargsを利用してください。

@raise WIN32OLERuntimeError WIN32OLE_EVENT#unadviseによってイベン...
...です。

ie = WIN32OLE.new('InternetExplorer.Application')
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
ev.on_event("NavigateComplete2") do |browser, url|
puts
url
end

同じオブジェクトに対してeventパラメータを指定したブロックと指定しないブ
ロッ...
...plication')
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
ev.on_event("NavigateComplete2") do |browser, url|
puts
url
end
ev.on_event do |*args| # <- NavigateComplete2イベント時は実行されない
puts
args[0]
end
...

当メソッドはイベント名の大文字...

WIN32OLE_EVENT#off_event(event = nil) -> () (148.0)

WIN32OLE_EVENT#on_eventで登録したブロックを解除します。

...WIN32OLE_EVENT#on_eventで登録したブロックを解除します。

@param event 文字列またはシンボルで登録時に指定したイベント名を指定しま
す。nilの場合、WIN32OLE_EVENT#on_eventに対してnilを指定したブロッ
クを解除します。

ev = WIN32OLE_...
...EVENT.new(ie, 'DWebBrowserEvents')
ev.on_event(:NavigateComplete) {|url| puts url }
...
ev.off_event(:NavigateComplete)...

WIN32OLE_EVENT#handler=(obj) -> () (25.0)

イベント処理を実行するオブジェクトを登録します。

...
解除するにはnilを指定します。

class IeHandler
def initialize
@completed = false
end
attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts
"#{e.innerHTML}=#{e.href}"
en...
...d
@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 = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://w...
...ww.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop
end
ie.Quit

WIN32OLE_EVENT#on_eventなどの呼び出しでブロックが登録されている場
合、そちらが優先されます。...