44件ヒット
[1-44件を表示]
(0.117秒)
種類
- インスタンスメソッド (22)
- 特異メソッド (22)
ライブラリ
- psych (11)
-
webrick
/ httpproxy (11) - win32ole (22)
クラス
-
Psych
:: Parser (11) -
WEBrick
:: HTTPProxyServer (11) -
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ TYPE (11)
キーワード
-
default
_ event _ sources (11) - new (22)
検索結果
先頭4件
-
WIN32OLE
_ EVENT # handler=(obj) -> () (27306.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}"
end
@completed = tru......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_... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (6206.0) -
型が持つソースインターフェイスを取得します。
...型が持つソースインターフェイスを取得します。
default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるイン......を持
たない場合は空配列を返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
tobj.default_event_sources.map {|intf| intf.name} #=> ["DocEvents"]
WIN32OLE_EVENT.newでインターフェイス名を指定しない場合は、ここ......odule_eval do
define_method("on#{m.name}") do |*arg|
if arg[0] == "ページが表示されました"
@completed = true
end
puts "#{Time.now}: #{m.name} was called"
p arg
end
end
end
evt = WIN32OLE_EVENT.new(ctl)
evt.handler = WebEvent.new
ctl.na... -
Psych
:: Parser . new(handler = Handler . new) -> Psych :: Parser (301.0) -
新たなパーサオブジェクトを生成して返します。
...新たなパーサオブジェクトを生成して返します。
handler で YAML のイベントを処理するハンドラを指定します。
詳しくは Psych::Parser を参照してください。
@param handler YAML のイベントを処理するハンドラ... -
WEBrick
:: HTTPProxyServer . new(config , default = WEBrick :: Config :: HTTP) -> WEBrick :: HTTPProxyServer (206.0) -
プロクシオブジェクトを生成して返します。
...トを引数として
proc.call(req, res) のように呼ばれます。
認証に失敗した場合 proc は適切な例外を発生させなければいけません。nil を指定した場合すべての接続を
受け付けます。デフォルトは nil です。通常は WEBrick::HTTPAu......使用します。
//emlist{
require 'webrick'
require 'webrick/httpproxy'
auth_proc = proc{|req, res|
unless c = req['proxy-authorization']
res['Proxy-Authenticate'] = 'Basic realm="WEBrick Proxy"'
raise WEBrick::HTTPStatus::ProxyAuthenticationRequired
else
# 略
end
}......ndler
接続先の HTTP サーバからの内容を処理する Proc オブジェクトを指定します。
レスポンスの内容を書き換えたりする事が出来ます。WEBrick::HTTPResponse オブジェクトと
WEBrick::HTTPRequest オブジェクトを引数として proc.call(r...