Class: Radiosonde::DSL::Context
- Inherits:
-
Object
- Object
- Radiosonde::DSL::Context
- Includes:
- Validator, TemplateHelper
- Defined in:
- lib/radiosonde/dsl/context.rb
Defined Under Namespace
Classes: Alarm
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
of class methods.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, options = {}, &block) ⇒ Context
constructor
A new instance of Context.
Methods included from TemplateHelper
Methods included from Validator
#_call_once, #_expected_type, #_identify, #_required, #_validate
Constructor Details
#initialize(path, options = {}, &block) ⇒ Context
Returns a new instance of Context.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/radiosonde/dsl/context.rb', line 15 def initialize(path, = {}, &block) @path = path @options = @result = OpenStruct.new(:alarms => []) @alarm_names = [] @context = Hashie::Mash.new( :path => path, :options => , :templates => {} ) instance_eval(&block) end |
Instance Attribute Details
#result ⇒ Object (readonly)
of class methods
13 14 15 |
# File 'lib/radiosonde/dsl/context.rb', line 13 def result @result end |
Class Method Details
.eval(dsl, path, opts = {}) ⇒ Object
6 7 8 9 10 |
# File 'lib/radiosonde/dsl/context.rb', line 6 def eval(dsl, path, opts = {}) self.new(path, opts) { eval(dsl, binding, path) } end |