るりまサーチ

最速Rubyリファレンスマニュアル検索!
9717件ヒット [9701-9717件を表示] (0.166秒)

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

ライブラリ

クラス

キーワード

検索結果

<< < ... 96 97 98 >>

String#slice(substr) -> String | nil (16.0)

self が substr を含む場合、一致した文字列を新しく作って返します。 substr を含まなければ nil を返します。

...た文字列を新しく作って返します。
substr を含まなければ nil を返します。

@param substr 取得したい文字列のパターン。文字列

//emlist[例][ruby]{
substr = "bar"
result = "foobar"[substr]
p result # => "bar"
p substr.equal?(result) # => false
//}...

Struct#deconstruct -> [object] (14.0)

構造体のメンバの値を配列にいれて返します。

...バの値を配列にいれて返します。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}

[注意] 本メソッドの記述は Struct の下位クラスのイ...
...ンスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。

@see d:spec/pattern_matching#matching_non_primitive_objects...
<< < ... 96 97 98 >>