Class: TextualRegexp::TxCollector

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

Instance Method Summary collapse

Constructor Details

#initialize(b) ⇒ TxCollector

Returns a new instance of TxCollector.



274
275
276
277
# File 'lib/texrex.rb', line 274

def initialize(b)
  @rx = []
  instance_eval(&b)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*a, &b) ⇒ Object



279
280
281
282
283
284
# File 'lib/texrex.rb', line 279

def method_missing(*a,&b)
  trx = TextualRegexp.new
  trx.send(*a,&b)
  @rx << trx
  self
end

Instance Method Details

#raw_rxObject



286
287
288
# File 'lib/texrex.rb', line 286

def raw_rx
  @rx.map {|rx| rx.raw_rx}.join("|")
end