Class: Lbrt::Space::DSL::Context
- Inherits:
-
Object
- Object
- Lbrt::Space::DSL::Context
- Includes:
- Utils::ContextHelper, Utils::TemplateHelper
- Defined in:
- lib/lbrt/space/dsl/context.rb
Defined Under Namespace
Classes: Space
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#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 Utils::TemplateHelper
Methods included from Utils::ContextHelper
Constructor Details
#initialize(path, options = {}, &block) ⇒ Context
Returns a new instance of Context.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lbrt/space/dsl/context.rb', line 14 def initialize(path, = {}, &block) @path = path @options = @result = {} @context = Hashie::Mash.new( :path => path, :options => , :templates => {} ) instance_eval(&block) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
12 13 14 |
# File 'lib/lbrt/space/dsl/context.rb', line 12 def context @context end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
11 12 13 |
# File 'lib/lbrt/space/dsl/context.rb', line 11 def result @result end |
Class Method Details
.eval(dsl, path, options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/lbrt/space/dsl/context.rb', line 5 def self.eval(dsl, path, = {}) self.new(path, ) { eval(dsl, binding, path) } end |