別のキーワード
ライブラリ
- ビルトイン (225)
- pp (11)
-
rdoc
/ context (11) - win32ole (88)
クラス
- Enumerator (58)
-
Enumerator
:: Lazy (44) - Module (11)
- Object (55)
- PP (11)
-
RDoc
:: Context (11) - Thread (11)
- WIN32OLE (22)
-
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ PARAM (22) -
WIN32OLE
_ TYPE (11)
モジュール
- Kernel (35)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Proc (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
-
WIN32OLE
_ METHOD (11) -
WIN32OLE
_ VARIABLE (11) - [] (11)
- default (11)
-
default
_ event _ sources (11) -
each
_ method (11) -
enum
_ for (44) - handler= (11)
-
instance
_ method (11) - lambda (17)
- new (14)
-
ole
_ func _ methods (11) -
ole
_ get _ methods (11) - output? (11)
- proc (18)
-
respond
_ to? (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) - seplist (11)
-
to
_ enum (44) -
webrick
/ cgi (11) - メソッド呼び出し(super・ブロック付き・yield) (11)
- 制御構造 (11)
- 手続きオブジェクトの挙動の詳細 (11)
検索結果
先頭5件
-
Enumerator
# each -> self (18182.0) -
生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。
...末尾へ追加する引数
//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"
enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } # => "Yet"
# "Another"
# "Ruby"......scan).each(/\w+/).to_a # => ["Hello", "world"]
obj = Object.new
def obj.each_arg(a, b=:b, *rest)
yield a
yield b
yield rest
:method_returned
end
enum = obj.to_enum :each_arg, :a, :x
enum.each.to_a # => [:a, :x, []]
enum.each.equal?(enum) # => true
enum.each { |e......lm| elm } # => :method_returned
enum.each(:y, :z).to_a # => [:a, :x, [:y, :z]]
enum.each(:y, :z).equal?(enum) # => false
enum.each(:y, :z) { |elm| elm } # => :method_returned
//}... -
Enumerator
# each { . . . } -> object (18182.0) -
生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。
...末尾へ追加する引数
//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"
enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } # => "Yet"
# "Another"
# "Ruby"......scan).each(/\w+/).to_a # => ["Hello", "world"]
obj = Object.new
def obj.each_arg(a, b=:b, *rest)
yield a
yield b
yield rest
:method_returned
end
enum = obj.to_enum :each_arg, :a, :x
enum.each.to_a # => [:a, :x, []]
enum.each.equal?(enum) # => true
enum.each { |e......lm| elm } # => :method_returned
enum.each(:y, :z).to_a # => [:a, :x, [:y, :z]]
enum.each(:y, :z).equal?(enum) # => false
enum.each(:y, :z) { |elm| elm } # => :method_returned
//}... -
Enumerator
# each(*args) -> Enumerator (18182.0) -
生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。
...末尾へ追加する引数
//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"
enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } # => "Yet"
# "Another"
# "Ruby"......scan).each(/\w+/).to_a # => ["Hello", "world"]
obj = Object.new
def obj.each_arg(a, b=:b, *rest)
yield a
yield b
yield rest
:method_returned
end
enum = obj.to_enum :each_arg, :a, :x
enum.each.to_a # => [:a, :x, []]
enum.each.equal?(enum) # => true
enum.each { |e......lm| elm } # => :method_returned
enum.each(:y, :z).to_a # => [:a, :x, [:y, :z]]
enum.each(:y, :z).equal?(enum) # => false
enum.each(:y, :z) { |elm| elm } # => :method_returned
//}... -
Enumerator
# each(*args) { . . . } -> object (18182.0) -
生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。
...末尾へ追加する引数
//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"
enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } # => "Yet"
# "Another"
# "Ruby"......scan).each(/\w+/).to_a # => ["Hello", "world"]
obj = Object.new
def obj.each_arg(a, b=:b, *rest)
yield a
yield b
yield rest
:method_returned
end
enum = obj.to_enum :each_arg, :a, :x
enum.each.to_a # => [:a, :x, []]
enum.each.equal?(enum) # => true
enum.each { |e......lm| elm } # => :method_returned
enum.each(:y, :z).to_a # => [:a, :x, [:y, :z]]
enum.each(:y, :z).equal?(enum) # => false
enum.each(:y, :z) { |elm| elm } # => :method_returned
//}... -
RDoc
:: Context # each _ method {|m| . . . } -> [RDoc :: AnyMethod] (12302.0) -
追加されたメソッド(RDoc::AnyMethod かそのサブクラスのオブジェクト) に対してブロックを評価します。
...追加されたメソッド(RDoc::AnyMethod かそのサブクラスのオブジェクト)
に対してブロックを評価します。... -
Module
# instance _ method(name) -> UnboundMethod (6243.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...クト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
clas......def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpreter = I... -
WIN32OLE
# ole _ func _ methods -> [WIN32OLE _ METHOD] (6235.0) -
オブジェクトのファンクション情報をWIN32OLE_METHODの配列として返し ます。
...32OLE_METHODの配列として返し
ます。
ole_func_methodsメソッドは、OLEオートメーションサーバのメソッドのうちファ
ンクション(何らかの機能的な操作)に属するものをWIN32OLE_METHODの
配列として返します。
@return WIN32OLE_METHODの......excel = WIN32OLE.new('Excel.Application')
excel.visible = true
excel.ole_func_methods.each do |fun|
if fun.name.upcase == 'QUIT'
excel._invoke(fun.dispid, [], [])
break
end
end
@see WIN32OLE#ole_methods, WIN32OLE#ole_get_methods,
WIN32OLE#ole_put_methods... -
WIN32OLE
# ole _ get _ methods -> [WIN32OLE _ METHOD] (6235.0) -
オブジェクトの参照可能プロパティ情報をWIN32OLE_METHODの配列として 返します。
...ティ情報をWIN32OLE_METHODの配列として
返します。
ole_get_methodsメソッドは、OLEオートメーションサーバのメソッドのうち読
み取り可能なプロパティをWIN32OLE_METHODの配列として返します。
@return WIN32OLE_METHODの配列。
@raise WIN32OLE......excel.ole_get_methods.each do |prop|
begin
puts "#{prop.name}=#{excel._getproperty(prop.dispid, [], [])}"
rescue WIN32OLERuntimeError
puts "can't read #{prop.name} property"
end
end
@see WIN32OLE#ole_methods, WIN32OLE#ole_func_methods,
WIN32OLE#ole_put_methods... -
WIN32OLE
_ METHOD (6060.0) -
OLEオートメーションサーバが持つメソッドの情報を提供します。
..._METHODは、WIN32OLE#ole_methodsなどの呼び出しによって返さ
れるオブジェクトで、OLEオートメーションサーバのメソッドの情報(メタデー
タ)を保持します。
=== サンプルコード
excel = WIN32OLE.new('Excel.Application')
excel.ole_methods.......each do |method|
if method.visible?
puts <<SIGNATURE
#{method.return_type} #{method.name}(#{
method.params.map {|p| "#{p.ole_type} #{p.name}"}.join(', ')
}) : #{method.helpstring}
SIGNATURE
end
end
@see WIN32OLE#ole_methods, WIN32OLE#ole_func_methods, WIN32OLE#ole_get_......methods, WIN32OLE#ole_put_methods, WIN32OLE#ole_method, WIN32OLE#ole_method_help, WIN32OLE_PARAM... -
Enumerator
. new(obj , method = :each , *args) -> Enumerator (268.0) -
オブジェクト obj について、 each の代わりに method という 名前のメソッドを使って繰り返すオブジェクトを生成して返します。 args を指定すると、 method の呼び出し時に渡されます。
...オブジェクト obj について、 each の代わりに method という
名前のメソッドを使って繰り返すオブジェクトを生成して返します。
args を指定すると、 method の呼び出し時に渡されます。
@param obj イテレータメソッドのレシーバ......method イテレータメソッドの名前を表すシンボルまたは文字列
@param args イテレータメソッドの呼び出しに渡す任意個の引数
//emlist[例][ruby]{
str = "xyz"
enum = Enumerator.new(str, :each_byte)
p enum.map {|b| '%02x' % b } # => ["78", "79", "7a"]
//}...