Class: Forkforge::Handler
Instance Method Summary collapse
-
#initialize(handler_class, *args) ⇒ Handler
constructor
A new instance of Handler.
- #method_missing(method, *args, &block) ⇒ Object
- #parse(input) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/forkforge/dsl/handler.rb', line 13 def method_missing method, *args, &block if @handler.respond_to? method @handler.send(method, *args, &block) @delayed.clear else @delayed.unshift "#{method}" end end |
Instance Method Details
#parse(input) ⇒ Object
22 23 24 25 26 |
# File 'lib/forkforge/dsl/handler.rb', line 22 def parse input self.instance_eval %Q{ #{File.read input} } end |