1080件ヒット
[1-100件を表示]
(0.170秒)
ライブラリ
- ビルトイン (410)
- csv (11)
- drb (11)
- erb (7)
-
irb
/ inspector (11) - matrix (55)
-
minitest
/ spec (3) - mkmf (88)
- pathname (33)
- prime (66)
- psych (34)
- rake (33)
-
rexml
/ document (33) -
rubygems
/ dependency _ installer (11) -
rubygems
/ source _ info _ cache (22) - shellwords (11)
- socket (66)
- win32ole (11)
クラス
- CSV (11)
-
DRb
:: DRbObject (11) - Data (2)
- ERB (7)
- Enumerator (44)
-
Enumerator
:: Lazy (10) -
Gem
:: DependencyInstaller (11) -
Gem
:: SourceInfoCache (22) - Hash (122)
-
IRB
:: Inspector (11) - Matrix (44)
- Method (11)
- Module (17)
- Object (2)
- Pathname (33)
-
Prime
:: PseudoPrimeGenerator (66) -
REXML
:: Child (11) -
REXML
:: Element (22) -
Rake
:: TaskArguments (11) - Refinement (3)
- Socket (33)
- String (22)
- Symbol (10)
- Thread (32)
- Time (11)
- Vector (11)
-
WIN32OLE
_ EVENT (11)
モジュール
- Enumerable (105)
- FileUtils (11)
- Kernel (88)
- Marshal (22)
- Psych (34)
-
Rake
:: TaskManager (11) - Shellwords (11)
-
Socket
:: Constants (33)
キーワード
- < (11)
-
IPV6
_ RECVHOPLIMIT (22) -
IPV6
_ RECVPATHMTU (22) -
IP
_ HDRINCL (22) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Rubyの起動 (11)
-
angle
_ with (11) -
check
_ signedness (22) - children (11)
-
convertible
_ int (22) - dump (44)
- each (22)
-
each
_ child (22) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) -
each
_ with _ index (66) -
each
_ with _ object (22) -
end
_ with? (16) -
enhance
_ with _ matching _ rule (11) - filter! (12)
-
find
_ gems _ with _ sources (11) -
import
_ methods (3) -
infect
_ with _ assertions (1) -
keep
_ if (22) -
keys
_ with _ inspector (11) -
max
_ by (44) -
must
_ be _ within _ delta (1) -
must
_ be _ within _ epsilon (1) - new (11)
-
new
_ with _ uri (11) -
on
_ event _ with _ outargs (11) -
rb
_ compile _ error _ with _ enc (11) -
rb
_ with _ disable _ interrupt (11) - receiver (11)
-
replace
_ with (11) -
report
_ on _ exception (16) -
report
_ on _ exception= (16) -
result
_ with _ hash (7) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby2
_ keywords (5) -
rubygems
/ commands / generate _ index _ command (11) -
rubygems
/ commands / pristine _ command (11) -
safe
_ load (12) -
search
_ with _ source (22) - select! (22)
- sh (11)
- shelljoin (11)
-
st
_ init _ numtable _ with _ size (11) -
st
_ init _ strtable _ with _ size (11) -
st
_ init _ table _ with _ size (11) -
start
_ with? (16) - strftime (11)
-
test
/ unit (1) -
to
_ h (17) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) -
with
_ config (22) -
with
_ defaults (11) -
with
_ index (54) -
with
_ object (44) -
with
_ werror (22) - 正規表現 (11)
検索結果
先頭5件
-
Data
# with(**kwargs) -> Data (30313.0) -
self をコピーしたオブジェクトを返します。
...ジェクトのメンバのオブジェクトはコピーされません。つまり参照しているオブジェクトが変わらない「浅い(shallow)」コピーを行います。
キーワード引数が指定された場合、引数に対応するメンバには引数の値が設定され......メンバの値を指定します。
@raise ArgumentError 存在しないメンバを指定した場合に発生します。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
dog1 = Dog.new("Fred", 5) # => #<data Dog name="Fred", age=5>
dog2 = dog1.with(age: 6) # => #<data Dog name="Fred", ag......e=6>
p dog1 # => #<data Dog name="Fred", age=5>
dog3 = dog1.with(type: "Terrier") # => ArgumentError (unknown keyword: :type)
# メンバのオブジェクトはコピーされず、同じオブジェクトを参照する。
dog1.name.upcase!
p dog1 # => #<data Dog name="FRED",... -
Prime
:: PseudoPrimeGenerator # each _ with _ index -> Enumerator (27416.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (27416.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (24544.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_wi......th_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) -> Enumerator (24444.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_wi......th_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 _ object(obj) -> Enumerator (24426.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... -
Enumerable
# each _ with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (24426.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... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (24425.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...ます。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指定すると、max の指定は無視さ......h文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b i......d='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//}... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (24425.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...ます。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指定すると、max の指定は無視さ......の最大個数
@param name xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> .........</>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}... -
Matrix
# each _ with _ index(which = :all) -> Enumerator (24408.0) -
行列の各要素をその位置とともに引数としてブロックを呼び出します。
...。
which で処理する要素の範囲を指定することができます。
Matrix#each と同じなのでそちらを参照してください。
ブロックを省略した場合、 Enumerator を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[ [1,2], [3,4] ].each_with_index do......|e, row, col|
puts "#{e} at #{row}, #{col}"
end
# => 1 at 0, 0
# => 2 at 0, 1
# => 3 at 1, 0
# => 4 at 1, 1
//}
@param which どの要素に対してブロックを呼び出すのかを Symbol で指定します
@see Matrix#each...