Class: Lbrt::Space::DSL::Context

Inherits:
Object
  • Object
show all
Includes:
Utils::ContextHelper, Utils::TemplateHelper
Defined in:
lib/lbrt/space/dsl/context.rb

Defined Under Namespace

Classes: Space

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::TemplateHelper

#include_template

Methods included from Utils::ContextHelper

#require, #template

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, options = {}, &block)
  @path = path
  @options = options
  @result = {}

  @context = Hashie::Mash.new(
    :path => path,
    :options => options,
    :templates => {}
  )

  instance_eval(&block)
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



12
13
14
# File 'lib/lbrt/space/dsl/context.rb', line 12

def context
  @context
end

#resultObject (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, options = {})
  self.new(path, options) {
    eval(dsl, binding, path)
  }
end