214件ヒット
[1-100件を表示]
(0.205秒)
種類
- インスタンスメソッド (199)
- 文書 (15)
クラス
-
ARGF
. class (36) -
Enumerator
:: Lazy (22) - IO (36)
- Module (11)
- String (58)
- StringIO (36)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- chars (64)
-
collect
_ concat (11) -
each
_ grapheme _ cluster (14) -
flat
_ map (11) -
instance
_ method (11)
検索結果
先頭5件
-
ARGF
. class # each _ char -> Enumerator (24468.0) -
レシーバに含まれる文字を一文字ずつブロックに渡して評価します。
...ーバに含まれる文字を一文字ずつブロックに渡して評価します。
このメソッドはスクリプトに指定した引数(Object::ARGV を参照) をファ
イル名とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオ
ブジェク......lename を使用します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_char # => #<E......numerator: ARGF:each_char>
ARGF.each_char{|e|p e}
# => "l"
# "i"
# "n"
# "e"
# "1"
# "\n"
# "l"
# "i"
# "n"
# "e"
# "2"
# "\n"
@see IO#each_char... -
ARGF
. class # each _ char { |c| . . . } -> self (24468.0) -
レシーバに含まれる文字を一文字ずつブロックに渡して評価します。
...ーバに含まれる文字を一文字ずつブロックに渡して評価します。
このメソッドはスクリプトに指定した引数(Object::ARGV を参照) をファ
イル名とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオ
ブジェク......lename を使用します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_char # => #<E......numerator: ARGF:each_char>
ARGF.each_char{|e|p e}
# => "l"
# "i"
# "n"
# "e"
# "1"
# "\n"
# "l"
# "i"
# "n"
# "e"
# "2"
# "\n"
@see IO#each_char... -
IO
# each _ char -> Enumerator (24414.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...self に含まれる文字を一文字ずつブロックに渡して評価します。
self は読み込み用にオープンされていなければなりません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読......み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>... -
IO
# each _ char {|c| . . . } -> self (24414.0) -
self に含まれる文字を一文字ずつブロックに渡して評価します。
...self に含まれる文字を一文字ずつブロックに渡して評価します。
self は読み込み用にオープンされていなければなりません。
ブロックを省略した場合は各文字について繰り返す Enumerator を返します。
@raise IOError self が読......み込み用にオープンされていない場合に発生します。
f = File.new("testfile")
f.each_char {|c| print c, ' ' } #=> #<File:testfile>... -
String
# each _ char -> Enumerator (24414.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
String
# each _ char {|cstr| block } -> self (24414.0) -
文字列の各文字に対して繰り返します。
...文字列の各文字に対して繰り返します。
たとえば、
//emlist[][ruby]{
"hello世界".each_char {|c| print c, ' ' }
//}
は次のように出力されます。
h e l l o 世 界
@see String#chars... -
StringIO
# each _ char -> Enumerator (24408.0) -
自身に含まれる文字を一文字ずつブロックに渡して評価します。
...自身に含まれる文字を一文字ずつブロックに渡して評価します。
自身は読み込み用にオープンされていなければなりません。
@raise IOError 自身が読み込み用にオープンされていない場合に発生します。
@see IO#each_char... -
StringIO
# each _ char {|c| . . . } -> self (24408.0) -
自身に含まれる文字を一文字ずつブロックに渡して評価します。
...自身に含まれる文字を一文字ずつブロックに渡して評価します。
自身は読み込み用にオープンされていなければなりません。
@raise IOError 自身が読み込み用にオープンされていない場合に発生します。
@see IO#each_char... -
StringIO
# each _ char -> Enumerator (18408.0) -
自身に含まれる文字を一文字ずつブロックに渡して評価します。
...自身に含まれる文字を一文字ずつブロックに渡して評価します。
自身は読み込み用にオープンされていなければなりません。
@raise IOError 自身が読み込み用にオープンされていない場合に発生します。
@see IO#each_char... -
StringIO
# each _ char {|c| . . . } -> self (18408.0) -
自身に含まれる文字を一文字ずつブロックに渡して評価します。
...自身に含まれる文字を一文字ずつブロックに渡して評価します。
自身は読み込み用にオープンされていなければなりません。
@raise IOError 自身が読み込み用にオープンされていない場合に発生します。
@see IO#each_char... -
Module
# instance _ method(name) -> UnboundMethod (6324.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#publ......nce_method, Object#method
//emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; end
def do_d() print "Hello "; end
def do_e() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_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!
//}... -
NEWS for Ruby 3
. 0 . 0 (6324.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 3.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......fferent behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 =>......=> [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-l...