14件ヒット
[1-14件を表示]
(0.073秒)
クラス
- Module (3)
-
WIN32OLE
_ TYPE (11)
検索結果
-
Module
# attr _ reader(*name) -> [Symbol] (42219.0) -
インスタンス変数 name の読み取りメソッドを定義します。
...定義します。
//emlist[例][ruby]{
class User
attr_reader :name # => [:name]
# 複数の名前を渡すこともできる
attr_reader :id, :age # => [:id, :age]
end
//}
このメソッドで定義されるメソッドの定義は以下の通りです。
//emlist[例][ruby]{
def name......@name
end
//}
@param name String または Symbol を 1 つ以上指定します。
@return 定義されたメソッド名を Symbol の配列で返します。... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (6118.0) -
型が持つソースインターフェイスを取得します。
...型が持つソースインターフェイスを取得します。
default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるイン......32
require 'win32ole'
type = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'InternetExplorer')
ctl = WIN32OLE.new(type.progid)
source = type.default_event_sources[0]
class WebEvent
def initialize
@completed = false
end
attr_reader :completed
end
source.ole_methods.each do |......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...