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.



495
496
497
498
# File 'lib/patm.rb', line 495

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

Instance Method Details

#===(obj) ⇒ Object



500
501
502
# File 'lib/patm.rb', line 500

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

#[](i) ⇒ Object



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

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