Class: Gratan::DSL::Context

Inherits:
Object
  • Object
show all
Includes:
Validator, Logger::Helper
Defined in:
lib/gratan/dsl/context.rb

Defined Under Namespace

Classes: On, User

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logger::Helper

#log

Methods included from Validator

#__identify, #__validate

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

Instance Attribute Details

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