種類
- インスタンスメソッド (47)
- 文書 (26)
ライブラリ
- ビルトイン (47)
クラス
-
ARGF
. class (36) - Module (11)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- chars (14)
-
instance
_ method (11)
検索結果
先頭5件
-
ARGF
. class # each _ char -> Enumerator (21132.0) -
レシーバに含まれる文字を一文字ずつブロックに渡して評価します。
...ARGF.class#filename を使用します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_char......# => #<Enumerator: 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 (21132.0) -
レシーバに含まれる文字を一文字ずつブロックに渡して評価します。
...ARGF.class#filename を使用します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを生成し
て返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_char......# => #<Enumerator: 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 # chars -> Enumerator (3032.0) -
このメソッドは obsolete です。 代わりに ARGF.class#each_char を使用してください。 使用すると警告メッセージが表示されます。
...このメソッドは obsolete です。
代わりに ARGF.class#each_char を使用してください。
使用すると警告メッセージが表示されます。... -
ARGF
. class # chars { |c| . . . } -> self (3032.0) -
このメソッドは obsolete です。 代わりに ARGF.class#each_char を使用してください。 使用すると警告メッセージが表示されます。
...このメソッドは obsolete です。
代わりに ARGF.class#each_char を使用してください。
使用すると警告メッセージが表示されます。... -
NEWS for Ruby 3
. 0 . 0 (96.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...d in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a Run......timeError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.
== Command line options
==......alled on subclass instances: 10845
* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each_char
* St... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (48.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
...ど 条件式 式 .. 式
条件式中の範囲式は特別にフリップフロップのように働きます。
//emlist{
'1234543212345'.each_char { |n| print( (n == ?2)..(n == ?4) ? n : '_' ) } #=> _234___21234_
#"2"が出るまではfalse、"2"が出てから"4"が出るまではtrue......でを文字列とする行指向のリテラルです。
: class Foo < Super
クラス定義でスーパークラスを指定しています。
d:spec/def#class。
: class << obj
特異クラス定義。d:spec/def#singleton_classを参照。
===[a:rangl] >
: 3 > 5
「より大きい」......。d:spec/variables#instanceを参照。
: @@xxx
クラス変数。d:spec/variables#classを参照。
: def +@ または def -@
単項演算子 +X や -X を定義するときの表記法。
//emlist{
class Symbol
def +@
self.upcase
end
end
puts(+:joke) #=> JOKE
//}
===[a... -
NEWS for Ruby 2
. 0 . 0 (36.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...' で始まる使用されていない変数は警告しなくなりました
=== 組み込みクラスの更新
* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO にある同名のメソッドに対応します
* Array
* 追加: Array#bsearch 二分探......した。そのようなときは ThreadError が発生します
* Mutex#sleep may spurious wakeup. Check after wakeup.
* NilClass
* 追加: NilClass#to_h 空のハッシュを返します
* ObjectSpace::WeakMap
* 弱い参照を保持するための低レベルのクラスです......IO#bytes,
Zlib::GzipReader#lines, Zlib::GzipReader#bytes
* これらのメソッドは非推奨になりました。each_line, each_byte, each_char, each_codepoint を使ってください。
* Proc#==, m:Proc#eql?
* 削除されました。2つの Proc オブジェクトは同じオ... -
Module
# instance _ method(name) -> UnboundMethod (12.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...f に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_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"; en......d(: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!
//}...