るりまサーチ

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

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. thread abort_on_exception
  5. thread abort_on_exception=

ライブラリ

クラス

キーワード

検索結果

WIN32OLE_EVENT#on_event(event = nil) {|*args| ... } -> () (18144.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パラメータを指定したブロックと指定しないブ
ロック...
...on')
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#on_event_with_outargs(event = nil) {|*args| ... } -> () (6120.0)

イベント通知を受けて結果を呼び出し元へ返すブロックを登録します。

...します。引数を省略した場合は、すべて
のイベントを対象とするブロックの登録となります。

WIN32OLE_EVENT#on_eventと異なり、イベントのブロック変数に戻り値を
設定できます。

@param event イベント名を文字列かシンボルで指...
...E.new('InternetExplorer.Application')
ev = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
ev.on_event('BeforeNavigate2') do |*args|
args[6] = true unless args[4] # Cancel = true unless PostData
end


当メソッドはイベント名の大文字小文字を区別するほか、イベント...

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

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

...def initialize
@completed = false
end

attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end

@completed = true
end

def method_missing(id, *args)
pu...
...t}"
end
end


ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop
end

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