Class: Gratan::DSL::Context
- Inherits:
-
Object
- Object
- Gratan::DSL::Context
- Includes:
- Validator, Logger::Helper
- Defined in:
- lib/gratan/dsl/context.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, options = {}, &block) ⇒ Context
constructor
A new instance of Context.
Methods included from Logger::Helper
Methods included from Validator
Constructor Details
#initialize(path, options = {}, &block) ⇒ Context
Returns a new instance of Context.
13 14 15 16 17 18 |
# File 'lib/gratan/dsl/context.rb', line 13 def initialize(path, = {}, &block) @path = path = @result = {} instance_eval(&block) end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
11 12 13 |
# File 'lib/gratan/dsl/context.rb', line 11 def result @result end |
Class Method Details
.eval(dsl, path, options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/gratan/dsl/context.rb', line 5 def self.eval(dsl, path, = {}) self.new(path, ) do eval(dsl, binding, path) end end |