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.



555
556
557
558
# File 'lib/patm.rb', line 555

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

Instance Method Details

#===(obj) ⇒ Object



560
561
562
# File 'lib/patm.rb', line 560

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

#[](i) ⇒ Object



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

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