Class: Cfdef::DSL::Context
- Inherits:
-
Object
- Object
- Cfdef::DSL::Context
- Defined in:
- lib/cfdef/dsl/context.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, options = {}, &block) ⇒ Context
constructor
A new instance of Context.
- #result ⇒ Object
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, = {}, &block) @path = path @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, = {}) self.new(path, ) { eval(dsl, binding, path) } end |
Instance Method Details
#result ⇒ Object
8 9 10 |
# File 'lib/cfdef/dsl/context.rb', line 8 def result @result.sort_array! end |