434件ヒット
[401-434件を表示]
(0.065秒)
クラス
-
ARGF
. class (12) - Array (21)
- Enumerator (24)
- Module (12)
- Range (5)
- String (260)
- StringIO (100)
キーワード
- % (2)
- bytes (38)
- chars (24)
- codepoints (24)
-
each
_ byte (48) -
each
_ char (24) -
each
_ codepoint (24) -
each
_ grapheme _ cluster (16) -
each
_ line (48) -
grapheme
_ clusters (16) -
inplace
_ mode (12) -
instance
_ method (12) - lines (38)
- pack (21)
- step (3)
- sum (12)
- unpack (12)
- upto (12)
-
with
_ object (24)
検索結果
先頭3件
-
Enumerator
# with _ object(obj) -> Enumerator (143.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...を返します。
//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}"
end
# => foo:0
# => foo:1......# => foo:2
//}
@param obj 繰り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (143.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...を返します。
//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}"
end
# => foo:0
# => foo:1......# => foo:2
//}
@param obj 繰り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object... -
Module
# instance _ method(name) -> UnboundMethod (131.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; e......method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!...