別のキーワード
種類
- インスタンスメソッド (481)
- 特異メソッド (196)
- モジュール関数 (79)
- クラス (11)
クラス
- Data (2)
- Enumerator (44)
-
Enumerator
:: Lazy (10) - Hash (122)
- IO (154)
- Method (73)
- Module (16)
- Proc (5)
- Refinement (3)
- String (76)
- Symbol (10)
- Thread (32)
- Time (11)
モジュール
- Enumerable (119)
- Kernel (57)
- Marshal (22)
キーワード
- < (11)
- === (7)
- Method (11)
- [] (11)
- abort (22)
- call (22)
- chunk (11)
- compact (3)
-
delete
_ prefix (7) -
delete
_ prefix! (7) -
delete
_ suffix (7) -
delete
_ suffix! (7) - dump (22)
-
each
_ with _ index (22) -
each
_ with _ object (22) -
end
_ with? (16) - exit (11)
- filter! (12)
-
import
_ methods (3) -
keep
_ if (22) -
max
_ by (44) - name (11)
- new (26)
- owner (11)
- popen (154)
- receiver (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) -
ruby2
_ keywords (10) - select! (22)
-
start
_ with? (16) - strftime (11)
- system (24)
-
to
_ h (17) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) -
with
_ index (32) -
with
_ object (22)
検索結果
先頭5件
-
Data
# with(**kwargs) -> Data (18115.0) -
self をコピーしたオブジェクトを返します。
...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)
# メンバのオブ... -
Symbol
# start _ with?(*prefixes) -> bool (6145.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...ます。
(self.to_s.start_with?と同じです。)
@param prefixes パターンを表す文字列または正規表現 (のリスト)
@see Symbol#end_with?
@see String#start_with?
//emlist[][ruby]{
:hello.start_with?("hell") #=> true
:hello.start_with?(/H/i) #=> t......rue
# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}... -
String
# start _ with?(*prefixes) -> bool (6139.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}
@see String#end_with?
@see String#delete_prefi... -
Symbol
# end _ with?(*suffixes) -> bool (6139.0) -
self の末尾が suffixes のいずれかであるとき true を返します。
...(self.to_s.end_with?と同じです。)
@param suffixes パターンを表す文字列 (のリスト)
@see Symbol#start_with?
@see String#end_with?
//emlist[][ruby]{
:hello.end_with?("ello") #=> true
# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven", "ell......o") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}... -
Enumerable
# each _ with _ index(*args) -> Enumerator (6134.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... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (6134.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... -
Enumerator
# with _ index(offset = 0) -> Enumerator (6128.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 _ index(offset = 0) {|(*args) , idx| . . . } -> object (6128.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) -> Enumerator (6128.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... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (6128.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... -
String
# end _ with?(*strs) -> bool (6127.0) -
self の末尾が strs のいずれかであるとき true を返します。
...ずれかであるとき 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?......@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#delete_suffix, String#delete_suffix!... -
String
# start _ with?(*strs) -> bool (6127.0) -
self の先頭が strs のいずれかであるとき true を返します。
...れかであるとき 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?...