Class: Burn::Fuel::DslBase
- Inherits:
-
Object
- Object
- Burn::Fuel::DslBase
- Includes:
- Debug
- Defined in:
- lib/burn/fuel/dsl_base.rb
Direct Known Subclasses
Rom::Declare, Rom::Music, Rom::Scene, Rom::Sound, Telnet::Declare, Telnet::Scene
Instance Method Summary collapse
-
#initialize(resource_name, context) ⇒ DslBase
constructor
A new instance of DslBase.
- #method_missing(method_symbol, *args, &block) ⇒ Object
Methods included from Debug
Constructor Details
#initialize(resource_name, context) ⇒ DslBase
Returns a new instance of DslBase.
11 12 13 14 |
# File 'lib/burn/fuel/dsl_base.rb', line 11 def initialize(resource_name, context) @resource_name = resource_name @context = context end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_symbol, *args, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/burn/fuel/dsl_base.rb', line 16 def method_missing(method_symbol, *args, &block) log :method_symbol=>method_symbol, :args=>args, :block=>block raise Exception.new "Unknown DSL '#{method_symbol}' is used." # # First argument will be block as always # args.unshift block # if @procs.key? method_symbol then # @context.instance_exec args, &@procs[method_symbol] # else # raise Exception.new "Unknown DSL '#{method_symbol}' is used." # end end |