Class: Vito::DslFile
- Inherits:
-
Object
- Object
- Vito::DslFile
- Defined in:
- lib/vito/dsl_file.rb
Instance Method Summary collapse
-
#initialize(argv = nil) ⇒ DslFile
constructor
A new instance of DslFile.
- #run(code_string = nil, &block) ⇒ Object
Constructor Details
#initialize(argv = nil) ⇒ DslFile
Returns a new instance of DslFile.
3 4 5 |
# File 'lib/vito/dsl_file.rb', line 3 def initialize(argv = nil) @argv = argv end |
Instance Method Details
#run(code_string = nil, &block) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/vito/dsl_file.rb', line 7 def run(code_string = nil, &block) if block_given? instance_eval(&block) else instance_eval(code_string) end end |