Class: FSM::GenericDSL
- Inherits:
-
Object
- Object
- FSM::GenericDSL
- Defined in:
- lib/fsm-0.0.0/dsl.rb
Direct Known Subclasses
Instance Method Summary collapse
- #configure(&b) ⇒ Object
-
#initialize(object) ⇒ GenericDSL
constructor
A new instance of GenericDSL.
- #method_missing(m, *a, &b) ⇒ Object
Constructor Details
#initialize(object) ⇒ GenericDSL
Returns a new instance of GenericDSL.
16 17 18 |
# File 'lib/fsm-0.0.0/dsl.rb', line 16 def initialize object @object = object end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *a, &b) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/fsm-0.0.0/dsl.rb', line 19 def method_missing m, *a, &b if @object.respond_to? m @object.send m, *a, &b else super end end |
Instance Method Details
#configure(&b) ⇒ Object
26 27 28 |
# File 'lib/fsm-0.0.0/dsl.rb', line 26 def configure &b instance_eval &b end |