Class: Cfdef::DSL::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/cfdef/dsl/context.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}, &block) ⇒ Context

Returns a new instance of Context.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cfdef/dsl/context.rb', line 12

def initialize(path, options = {}, &block)
  @path = path
  @options = options

  @result = {
    distributions: {},
    # TODO:
    #streaming_distributions: {},
  }

  instance_eval(&block)
end

Class Method Details

.eval(dsl, path, options = {}) ⇒ Object



2
3
4
5
6
# File 'lib/cfdef/dsl/context.rb', line 2

def self.eval(dsl, path, options = {})
  self.new(path, options) {
    eval(dsl, binding, path)
  }
end

Instance Method Details

#resultObject



8
9
10
# File 'lib/cfdef/dsl/context.rb', line 8

def result
  @result.sort_array!
end