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.



648
649
650
651
# File 'lib/patm.rb', line 648

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

Instance Method Details

#===(obj) ⇒ Object



653
654
655
# File 'lib/patm.rb', line 653

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

#[](i) ⇒ Object



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

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