466件ヒット
[1-100件を表示]
(0.127秒)
別のキーワード
ライブラリ
- ビルトイン (310)
- matrix (60)
- pathname (36)
- prime (48)
-
rexml
/ document (12)
クラス
- Data (3)
- Hash (100)
- Matrix (48)
- Method (44)
- Module (12)
- Pathname (36)
-
Prime
:: PseudoPrimeGenerator (48) -
REXML
:: Child (12) - Refinement (4)
- String (40)
- Symbol (12)
- Vector (12)
モジュール
- Enumerable (95)
キーワード
- < (12)
- === (8)
- [] (12)
-
angle
_ with (12) - call (24)
- children (12)
- compact (4)
-
delete
_ prefix! (8) -
delete
_ suffix! (8) - each (24)
-
each
_ child (24) -
each
_ with _ index (72) -
end
_ with? (18) - filter! (14)
-
import
_ methods (4) -
keep
_ if (24) -
max
_ by (48) -
replace
_ with (12) - select! (24)
-
start
_ with? (18) -
to
_ h (19) -
transform
_ keys! (20) -
transform
_ values! (18) -
with
_ index (24)
検索結果
先頭5件
-
Data
# with(**kwargs) -> Data (18130.0) -
self をコピーしたオブジェクトを返します。
...
self をコピーしたオブジェクトを返します。
値オブジェクトのメンバのオブジェクトはコピーされません。つまり参照しているオブジェクトが変わらない「浅い(shallow)」コピーを行います。
キーワード引数が指定された......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)
# メンバのオブ... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (6234.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...た場合は、
要素とそのインデックスを繰り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args......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... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (6225.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
... self を返します。 ブロックを与えられなかった場合は 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_in... -
Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self (6225.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
... self を返します。 ブロックを与えられなかった場合は 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_in... -
REXML
:: Child # replace _ with(child) -> self (6219.0) -
親ノードの子ノード列上において、 self を child に置き換えます。
...親ノードの子ノード列上において、 self を child に置き換えます。
@param child 置き換え後のノード
@see REXML::Parent#replace_child... -
Matrix
# each _ with _ index(which = :all) {|e , row , col| . . . } -> self (6210.0) -
行列の各要素をその位置とともに引数としてブロックを呼び出します。
...ださい。
ブロックを省略した場合、 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
# start _ with?(*prefixes) -> bool (6166.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...
self の先頭が prefixes のいずれかであるとき true を返します。
(self.to_s.start_with?と同じです。)
@param prefixes パターンを表す文字列または正規表現 (のリスト)
@see Symbol#end_with?
@see String#start_with?
//emlist[][ruby]{
:hello.start_with?("hel......l") #=> true
:hello.start_with?(/H/i) #=> true
# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}... -
Symbol
# end _ with?(*suffixes) -> bool (6160.0) -
self の末尾が suffixes のいずれかであるとき true を返します。
...
self の末尾が suffixes のいずれかであるとき true を返します。
(self.to_s.end_with?と同じです。)
@param suffixes パターンを表す文字列 (のリスト)
@see Symbol#start_with?
@see String#end_with?
//emlist[][ruby]{
:hello.end_with?("ello") #=> tru......e
# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}... -
String
# start _ with?(*prefixes) -> bool (6154.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...
self の先頭が prefixes のいずれかであるとき true を返します。
@param prefixes パターンを表す文字列または正規表現 (のリスト)
//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_w......ith?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}
@see String#end_with?
@see String#delete_prefix, String#delete_prefix!... -
String
# end _ with?(*strs) -> bool (6142.0) -
self の末尾が strs のいずれかであるとき true を返します。
...
self の末尾が strs のいずれかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
/....../}
@see String#start_with?....../}
@see String#start_with?
@see String#delete_suffix, String#delete_suffix!... -
String
# start _ with?(*strs) -> bool (6142.0) -
self の先頭が strs のいずれかであるとき true を返します。
...
self の先頭が strs のいずれかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # =>......true
//}
@see String#end_with?... -
Vector
# angle _ with(v) -> Float (6142.0) -
v と self がなす角度を返します。
...v と self がなす角度を返します。
//emlist[例][ruby]{
require 'matrix'
Vector[1, 0].angle_with(Vector[0, 1]) # => Math::PI/2
//}
@param v このベクトルと self とがなす角度を計算します
@raise ZeroVectorError self もしくは v のどちらかが零ベクトルであ......る場合に
発生します
@raise ExceptionForMatrix::ErrDimensionMismatch v と self の
ベクトルの次元が異なる場合に発生します。...