423件ヒット
[101-200件を表示]
(0.074秒)
クラス
-
ARGF
. class (24) - Array (24)
- Binding (11)
- Enumerator (36)
-
Enumerator
:: Lazy (48) - Float (22)
- Integer (72)
- Object (48)
-
Rake
:: FileCreationTask (12) -
Rake
:: FileTask (12) -
Rake
:: Task (12) -
Socket
:: AncillaryData (12) - String (12)
-
Thread
:: ConditionVariable (24) - ThreadsWait (42)
モジュール
- Kernel (12)
キーワード
- * (36)
-
all
_ waits (6) - broadcast (12)
- downto (24)
- empty? (6)
-
enum
_ for (48) - eof (12)
- eof? (12)
- finished? (6)
- join (6)
-
join
_ nowait (6) -
local
_ variables (11) - modified? (12)
- next (12)
-
next
_ float (11) -
next
_ wait (6) -
prev
_ float (11) - signal (12)
- threads (6)
-
to
_ enum (48) - upto (24)
-
with
_ object (24)
検索結果
先頭5件
-
Kernel
# modified?(target , times) -> Time | nil (124.0) -
target が times の全ての要素よりも新しい場合は target の更新時刻を返します。 そうでない場合は nil を返します。target が存在しない場合も nil を返します。
...target が times の全ての要素よりも新しい場合は target の更新時刻を返します。
そうでない場合は nil を返します。target が存在しない場合も nil を返します。
@param target 対象のファイル名を指定します。
@param times Time の配列... -
ARGF
. class # eof -> bool (7.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 (7.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] (7.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 (7.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 (7.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 (7.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
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (7.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError 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]... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (7.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
...# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError 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]...