Class: Lbrt::Alert::DSL::Context
- Inherits:
-
Object
- Object
- Lbrt::Alert::DSL::Context
- Includes:
- Utils::ContextHelper, Utils::TemplateHelper
- Defined in:
- lib/lbrt/alert/dsl/context.rb
Defined Under Namespace
Classes: Alert
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client, path, options = {}, &block) ⇒ Context
constructor
A new instance of Context.
Methods included from Utils::TemplateHelper
Methods included from Utils::ContextHelper
Constructor Details
#initialize(client, path, options = {}, &block) ⇒ Context
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lbrt/alert/dsl/context.rb', line 14 def initialize(client, path, = {}, &block) @path = path = @result = {} @services = Lbrt::Service::Exporter.export(client, ) @context = Hashie::Mash.new( :path => path, :options => , :templates => {} ) instance_eval(&block) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
12 13 14 |
# File 'lib/lbrt/alert/dsl/context.rb', line 12 def context @context end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
11 12 13 |
# File 'lib/lbrt/alert/dsl/context.rb', line 11 def result @result end |
Class Method Details
.eval(client, dsl, path, options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/lbrt/alert/dsl/context.rb', line 5 def self.eval(client, dsl, path, = {}) self.new(client, path, ) { eval(dsl, binding, path) } end |