るりまサーチ

最速Rubyリファレンスマニュアル検索!
14件ヒット [1-14件を表示] (0.073秒)
トップページ > クエリ:l[x] > クエリ:Module[x] > クエリ:class[x] > クエリ:attr_reader[x]

別のキーワード

  1. argf.class lines
  2. argf.class each_line
  3. argf.class each
  4. argf.class to_a
  5. argf.class readlines

ライブラリ

クラス

検索結果

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...