290件ヒット
[1-100件を表示]
(0.021秒)
ライブラリ
- ビルトイン (290)
クラス
-
ARGF
. class (22) - Array (22)
- Binding (10)
- Enumerator (33)
-
Enumerator
:: Lazy (44) - Float (20)
- Integer (66)
- Object (44)
- String (11)
-
Thread
:: ConditionVariable (18)
キーワード
- * (33)
- broadcast (9)
- downto (22)
-
enum
_ for (44) - eof (11)
- eof? (11)
-
local
_ variables (10) - next (11)
-
next
_ float (10) -
prev
_ float (10) - signal (9)
-
to
_ enum (44) - upto (22)
-
with
_ object (22)
検索結果
先頭5件
-
Integer
# times -> Enumerator (26121.0) -
self 回だけ繰り返します。 self が正の整数でない場合は何もしません。
...ら self - 1 までの数値が渡されます。
//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}
@see Integer#... -
Integer
# times {|n| . . . } -> self (26121.0) -
self 回だけ繰り返します。 self が正の整数でない場合は何もしません。
...ら self - 1 までの数値が渡されます。
//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}
@see Integer#... -
String
# *(times) -> String (8130.0) -
文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。
...文字列の内容を times 回だけ繰り返した新しい文字列を作成して返します。
@param times 整数
@return self を times 回繰り返した新しい文字列
@raise ArgumentError 引数に負数を指定したときに発生します。
//emlist[例][ruby]{
p "s... -
Array
# *(times) -> Array (8124.0) -
配列の内容を times 回 繰り返した新しい配列を作成して返します。 値はコピーされないことに注意してください。
...配列の内容を times 回 繰り返した新しい配列を作成して返します。
値はコピーされないことに注意してください。
@param times 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_in... -
ARGF
. class # eof -> bool (8007.0) -
現在開いているファイルがEOFに達したらtrueを返します。そうでない場合は falseを返します。
...IOError ファイルがopenされていない場合に発生します。
$ echo "eof" | ruby argf.rb
ARGF.eof? # => false
3.times { ARGF.readchar }
ARGF.eof? # => false
ARGF.readchar # => "\n"
ARGF.eof? # => true
@see IO#eof,... -
ARGF
. class # eof? -> bool (8007.0) -
現在開いているファイルがEOFに達したらtrueを返します。そうでない場合は falseを返します。
...IOError ファイルがopenされていない場合に発生します。
$ echo "eof" | ruby argf.rb
ARGF.eof? # => false
3.times { ARGF.readchar }
ARGF.eof? # => false
ARGF.readchar # => "\n"
ARGF.eof? # => true
@see IO#eof,... -
Binding
# local _ variables -> [Symbol] (8007.0) -
ローカル変数の一覧を Symbol の配列で返します。
...ローカル変数の一覧を Symbol の配列で返します。
//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
binding.local_variables #=> [:a, :n]
end
end
//}
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("local_variables"... -
Enumerator
# next -> object (8007.0) -
「次」のオブジェクトを返します。
...列挙状態が既に最後へ到達しているとき
@see Enumerator#rewind
//emlist[例1][ruby]{
str = "xyz"
enum = str.each_byte
str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}
//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte
begin
puts enum.next... -
Enumerator
# with _ object(obj) -> Enumerator (8007.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times 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}"
e... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (8007.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times 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}"
e...