るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.019秒)
トップページ > クエリ:String[x] > ライブラリ:rinda/rinda[x]

別のキーワード

  1. string []=
  2. string []
  3. string slice
  4. string slice!
  5. string gsub

検索結果

Rinda::Template (14.0)

タプルのマッチングのためのクラスです。 ユーザがこのクラスを直接使うことはありません。

...使うことはありません。

=== 例

require 'rinda/rinda'

template = Rinda::Template.new(['abc', nil, nil])
template.match(['abc', 2, 5]) # => true
template.match(['hoge', 2, 5]) # => false

template = Rinda::Template.new([String, Integer, nil])
template.match(['abc', 2, 5]) # =...
...template.match(['abc', 2, 5]) # => true
template.match(['def', 2, 5]) # => false

template = Rinda::Template.new({'name' => String, 'age' => Integer})
template.match({'name' => 'seki', 'age' => 0x20}) # => true
template.match({'name' => :seki, 'age' => 0x20}) # => fals...