キーワード
- Marshal フォーマット (12)
-
NEWS for Ruby 3
. 0 . 0 (5) - Ruby用語集 (12)
-
ruby 1
. 6 feature (12) - パターンマッチ (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- リテラル (12)
検索結果
-
Ruby用語集 (487.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...ンの
間でオブジェクトにアクセスできる。
===[a:E] E
: ENV
環境変数にアクセスするためのオブジェクト。
Hash に似たインターフェースを持つ。キーも値も文字列である。
ENV で環境変数を変更すると Ruby の子プロセス......し、切り替えて使うための
ツールの一つ。Linux、macOS などで動作する。
https://github.com/rbenv/rbenv
: RD(Ruby Document format)
Ruby スクリプト中に記述することを念頭に作られたドキュメントフォーマット。
: RDoc
Ruby スクリ......し、合わせてドキュメントの HTML を生成する。
参照:rdoc
: refinement
既存のクラスやモジュールを特定のスコープでのみ改変する仕組み。
参照:Module#refine、Module#using、main.using
: Ruby Central
Rubyのサポートと世界の Ruby... -
リテラル (399.0)
-
リテラル * num * string * backslash * exp * char * command * here * regexp * array * hash * range * symbol * percent
...リテラル
* num
* string
* backslash
* exp
* char
* command
* here
* regexp
* array
* hash
* range
* symbol
* percent
数字の1や文字列"hello world"のようにRubyのプログラムの中に直接
記述できる値の事をリテラルといいます。
===[a:n......の
前(符号(+,-)の直後を含む)に _を置くとローカル変数やメソッド呼び
出しと解釈されます)
_ は、0x などの prefix の直後に書くことはできません。また、_ を連続して
書いてもエラーになります。他、細かい部分でこのあた......<<EOS,
3055 * 2 / 5) # <- この行はヒアドキュメントに含まれてしまう
This line is a here document.
EOS
開始ラベルを `<<-識別子' または `<<~識別子` のように
`-' または `~' を付けて書くことで、終端行... -
パターンマッチ (219.0)
-
パターンマッチ * patterns * variable_binding * variable_pinning * matching_non_primitive_objects * guard_clauses * current_feature_status * pattern_syntax * some_undefined_behavior_examples
...)
* Array パターン: 『[<subpattern>, <subpattern>, <subpattern>, ...]』 (「Array パターン」)
* Hash パターン: 『{key: <subpattern>, key: <subpattern>, ...}』 (「Hash パターン」)
* 『|』 でのパターンの組み合わせ (「Alternative パターン」)
* 変数......ン」)
Array/Hash パターンの中に 『<subpattern>』 と書かれている場所では任意のパターンをネストさせることができます。
Array パターン は配列か deconstruct メソッド(後述)を持つオブジェクトにマッチします。
Hash パターン は......シュか deconstruct_keys メソッド(後述)を持つオブジェクトにマッチします。Hash パターン で利用できるキーはシンボルのみです。
Array パターン と Hash パターン の挙動の重要な違いは Array パターンは配列の 「全ての」 要素が......ン: 『[*variable, <subpattern>, <subpattern>, <subpattern>, ..., *variable]』 (「Find パターン」)
* Hash パターン: 『{key: <subpattern>, key: <subpattern>, ...}』 (「Hash パターン」)
* 『|』 でのパターンの組み合わせ (「Alternative パターン」)
* 変数......Find/Hash パターンの中に 『<subpattern>』 と書かれている場所では任意のパターンをネストさせることができます。
Array パターン と Find パターン は配列か deconstruct メソッド(後述)を持つオブジェクトにマッチします。
Hash パ... -
メソッド呼び出し(super・ブロック付き・yield) (179.0)
-
メソッド呼び出し(super・ブロック付き・yield) * super * block * yield * block_arg * numbered_parameters * it * call_method
...シュ式の解説(d:spec/literal#hash)にも書かれている通り、
メソッド呼出の末尾にHashを渡す場合は {, } を省略することができます。
これを用いることでキーワード引数を渡すことができます。
この Hash はd:spec/def#methodで解説され... -
Marshal フォーマット (97.0)
-
Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。
...egexp, Array, Hash のサブクラス (インスタンス変数なし)
'C' で始まるデータ構造になります。
//emlist{
| 'C' | クラス名(Symbol)の dump | 親クラスのインスタンスの dump |
//}
//emlist[例 1][ruby]{
class Foo < Array # (or String, Regexp, Hash)
end
p Mars......egexp, Array, Hash のサブクラス (インスタンス変数あり)
'I' で始まるデータ構造になります。
d:marshal_format#instance_variableも参照してください。
//emlist[例 2: インスタンス変数あり][ruby]{
class Foo < Array # (or String, Regexp, Hash)
def initi......素の dump | ... |
//}
//emlist[例][ruby]{
p Marshal.dump([true, false, nil]).unpack("x2 a c a a a")
# => ["[", 8, "T", "F", "0"]
//}
=== Hash
==== Hash without default value
'{' で始まるデータ構造になります。
//emlist{
| '{' | 要素数(Fixnum形式) | キーの dump | 値の... -
NEWS for Ruby 3
. 0 . 0 (85.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-label:label-Static+analysis] foundation is
in......ob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added......cant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has been added, which returns a hash excluding the given keys and their values. 15822
* IO
* IO#n... -
ruby 1
. 6 feature (67.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...うです。
((<ruby-win32:273>))
: 2002-08-12 Hash#==
Hash オブジェクトはデフォルト値 (((<Hash/default>))) も == で等しい
ときに等しいとみなされるようになりました。
p Hash.new("foo") == Hash.new("bar")
=> ruby 1.6.7 (2002-03-01) [i586......[]
=> ruby 1.6.7 (2002-08-01) [i586-linux]
["bar"]
: 2002-06-13 Hash[]
Hash[] で、キーとなる文字列を dup & freeze していませんでした。
a = "key"
h = Hash[a,"val"]
h.keys[0].upcase!
p a
=> ruby 1.6.7 (2002-03-01) [......ameError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby 1.6.7 (2002-03-15) [i586-linux]
: 2002-03-13 ((<getopts>))
refine. ((<ruby-dev:16193>)), ((<ruby-dev:16213>))
: 2002-03-11 正規表現中の 8 進コード
正規表現中の \nnn による 8 進記法...