454件ヒット
[1-100件を表示]
(0.016秒)
ライブラリ
- ビルトイン (388)
- continuation (12)
-
rubygems
/ source _ info _ cache (12) - win32ole (24)
クラス
- Data (3)
- Enumerator (48)
-
Enumerator
:: Lazy (12) -
Gem
:: SourceInfoCache (12) - IO (168)
- Method (44)
- Module (12)
- Proc (6)
-
WIN32OLE
_ EVENT (24)
モジュール
- Enumerable (67)
- Kernel (28)
キーワード
- === (8)
- Continuation (12)
-
NEWS for Ruby 2
. 7 . 0 (6) - [] (12)
- call (24)
-
each
_ with _ index (24) -
each
_ with _ object (24) -
on
_ event (12) -
on
_ event _ with _ outargs (12) - popen (168)
-
ruby2
_ keywords (18) -
rubygems
/ commands / pristine _ command (12) -
search
_ with _ source (12) - system (28)
-
to
_ h (19) -
with
_ index (36) -
with
_ object (24)
検索結果
先頭5件
-
Data
# with(**kwargs) -> Data (18213.0) -
self をコピーしたオブジェクトを返します。
...応するメンバには引数の値が設定されます。存在しないメンバを指定した場合はエラーとなります。
@param kwargs コピーされたオブジェクトに設定されるメンバの値を指定します。
@raise ArgumentError 存在しないメンバを指定し......me, :age)
dog1 = Dog.new("Fred", 5) # => #<data Dog name="Fred", age=5>
dog2 = dog1.with(age: 6) # => #<data Dog name="Fred", age=6>
p dog1 # => #<data Dog name="Fred", age=5>
dog3 = dog1.with(type: "Terrier") # => ArgumentError (unknown keyword: :type)
# メンバのオブ... -
WIN32OLE
_ EVENT # on _ event _ with _ outargs(event = nil) {|*args| . . . } -> () (12326.0) -
イベント通知を受けて結果を呼び出し元へ返すブロックを登録します。
...。イベント名は大文
字小文字を区別します。省略時にはすべてのイベントが対象となります。
@param args サーバがイベント通知時に指定した引数の配列です。
eventパラメータを省略した場合、第1要素には......32OLE.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
当メソッドはイベント名の大文字小文字を区別するほか、イベン... -
Enumerable
# each _ with _ index(*args) -> Enumerator (6240.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡......each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (6240.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡......each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerator
# with _ index(offset = 0) {|(*args) , idx| . . . } -> object (6227.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...r = "xyz"
enum = Enumerator.new {|y| str.each_byte {|b| y << b }}
enum.with_index {|byte, idx| p [byte, idx] }
# => [120, 0]
# [121, 1]
# [122, 2]
require "stringio"
StringIO.new("foo|bar|baz").each("|").with_index(1) {|s, i| p [s, i] }
# => ["foo|", 1]
# ["bar|", 2]......にインデックスを添えてブロックを繰り返します。
インデックスは 0 から始まります。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (6227.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...do |x|
y << x
end
end
to_three_with_string = to_three.with_object("foo")
to_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# => foo:0
# => foo:1
# => foo:2
//}
@param obj 繰り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object... -
Gem
:: SourceInfoCache . search _ with _ source(*args) -> Array (6220.0) -
与えられた条件を満たす Gem::Specification と URL のリストを返します。
...与えられた条件を満たす Gem::Specification と URL のリストを返します。
@param args 検索条件を指定します。Gem::SourceInfoCache#search_with_source と引数を合わせてください。
@see Gem::SourceInfoCache#search_with_source... -
Enumerable
# each _ with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (6215.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
...返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object... -
Enumerator
:: Lazy # with _ index(offset = 0) {|(*args) , idx| . . . } -> Enumerator :: Lazy (6215.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...クスは offset から始まります。
ブロックを指定した場合の戻り値は生成時に指定したレシーバ自身です。
//emlist[][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
# 2:b
# 3:c
//}
@see Enumerator#with_index... -
Enumerator
# with _ index(offset = 0) -> Enumerator (6127.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...r = "xyz"
enum = Enumerator.new {|y| str.each_byte {|b| y << b }}
enum.with_index {|byte, idx| p [byte, idx] }
# => [120, 0]
# [121, 1]
# [122, 2]
require "stringio"
StringIO.new("foo|bar|baz").each("|").with_index(1) {|s, i| p [s, i] }
# => ["foo|", 1]
# ["bar|", 2]......にインデックスを添えてブロックを繰り返します。
インデックスは 0 から始まります。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。...