Class: TextualRegexp::TxCollector
- Inherits:
-
Object
- Object
- TextualRegexp::TxCollector
- Defined in:
- lib/texrex.rb
Instance Method Summary collapse
-
#initialize(b) ⇒ TxCollector
constructor
A new instance of TxCollector.
- #method_missing(*a, &b) ⇒ Object
- #raw_rx ⇒ Object
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_rx ⇒ Object
286 287 288 |
# File 'lib/texrex.rb', line 286 def raw_rx @rx.map {|rx| rx.raw_rx}.join("|") end |