Class: Patm::CaseBinder

Inherits:
Object
  • Object
show all
Defined in:
lib/patm.rb

Instance Method Summary collapse

Constructor Details

#initialize(pat) ⇒ CaseBinder

Returns a new instance of CaseBinder.



360
361
362
363
# File 'lib/patm.rb', line 360

def initialize(pat)
  @pat = pat
  @match = Match.new
end

Instance Method Details

#===(obj) ⇒ Object



365
366
367
# File 'lib/patm.rb', line 365

def ===(obj)
  @pat.execute(@match, obj)
end

#[](i) ⇒ Object



369
# File 'lib/patm.rb', line 369

def [](i); @match[i]; end