Module: Robotnik::DslEval

Defined in:
lib/dsl_eval.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



10
11
12
# File 'lib/dsl_eval.rb', line 10

def method_missing method, *args, &block
  @previous_self.send method, *args, &block
end

Instance Method Details

#evaluate(&block) ⇒ Object



4
5
6
7
8
# File 'lib/dsl_eval.rb', line 4

def evaluate &block
  @previous_self = eval 'self', block.binding
  instance_eval &block
  self
end