Class: MetaCodeCommenter::Evaluator
- Inherits:
-
Object
- Object
- MetaCodeCommenter::Evaluator
show all
- Defined in:
- lib/meta_code_commenter.rb
Instance Method Summary
collapse
Constructor Details
#initialize(vars) ⇒ Evaluator
12
13
14
15
16
17
18
19
20
|
# File 'lib/meta_code_commenter.rb', line 12
def initialize(vars)
vars.each do |key, value|
eval " def \#{key}\n \#{value.inspect}\n end\n RUBY\n end\nend\n"
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
26
27
28
|
# File 'lib/meta_code_commenter.rb', line 26
def method_missing(method, *args, &block)
method.to_s
end
|
Instance Method Details
#__eval__(line) ⇒ Object
22
23
24
|
# File 'lib/meta_code_commenter.rb', line 22
def __eval__(line)
eval(%{"#{line}"})
end
|