るりまサーチ

最速Rubyリファレンスマニュアル検索!
159件ヒット [1-100件を表示] (0.070秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

キーワード

検索結果

<< 1 2 > >>

String#*(times) -> String (26349.0)

文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。

...内容を times 回だけ繰り返した新しい文字列を作成して返します。

@param times 整数
@return self を times 回繰り返した新しい文字列

@raise ArgumentError 引数に負数を指定したときに発生します。

//emlist[例][ruby]{
p "str" * 3 # =...
...> "strstrstr"

str = "abc"
p str * 4 # => "abcabcabcabc"
p str * 0 # => ""
p str # => "abc" (変化なし)
//}...

Array#*(times) -> Array (26332.0)

配列の内容を times 回 繰り返した新しい配列を作成して返します。 値はコピーされないことに注意してください。

...配列の内容を times 回 繰り返した新しい配列を作成して返します。
値はコピーされないことに注意してください。

@param times 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_in...
...or 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

@raise ArgumentError 引数に負の数を指定した場合に発生します。

//emlist[例][ruby]{
p [1, 2, 3] * 3 #=> [1, 2, 3, 1, 2, 3, 1, 2, 3]
//}...

Array#*(sep) -> String (26212.0)

指定された sep を間にはさんで連結した文字列を生成して返します。Array#join(sep) と同じ動作をします。

...ep) と同じ動作をします。

@param sep 文字列を指定します。
文字列以外のオブジェクトを指定した場合は to_str メソッドによ
る暗黙の型変換を試みます。

//emlist[例][ruby]{
p [1,2,3] * ","
# => "1,2,3"
//}

@see Array#join...

Numeric (10228.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...れています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどで...
...を定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれば、数値クラスのそのほかのメソッドが
適切に定義されることを意図して提供されています。

+@, -@ は単項演算子 +, - を表しメソッド定義などではこの記...
...95 (2014-05-08 revision 45877) [x86_64-linux]
Numeric Integer Fixnum Bignum Float Rational Complex
-
------------------------------------------------------------------------------------------
% | o -...
...198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric Integer Float Rational Complex
-
-------------------------------------------------------------------------------
% | o o o - -...

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (8346.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'w...

絞り込み条件を変える

Object#to_enum(method = :each, *args) {|*args| ... } -> Enumerator (8346.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'w...

Enumerator::Lazy#enum_for(method = :each, *args) {|*args| block} -> Enumerator::Lazy (8318.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...if n < 0
if block_given?
each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end

r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

#...

Enumerator::Lazy#to_enum(method = :each, *args) {|*args| block} -> Enumerator::Lazy (8318.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...if n < 0
if block_given?
each do |*val|
n.times { yield *val }
end
else
to_enum(:repeat, n)
end
end
end

r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

#...

Object#enum_for(method = :each, *args) -> Enumerator (8246.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'w...

Object#to_enum(method = :each, *args) -> Enumerator (8246.0)

Enumerator.new(self, method, *args) を返します。

...Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出...
...return to_enum(__method__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'w...

絞り込み条件を変える

<< 1 2 > >>