Class: Meteorlog::DSL::Context

Inherits:
Object
  • Object
show all
Includes:
Validator, TemplateHelper
Defined in:
lib/meteorlog/dsl/context.rb

Defined Under Namespace

Classes: LogGroup, MetricFilter

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TemplateHelper

#context, #include_template

Methods included from Validator

#_call_once, #_expected_length, #_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
# File 'lib/meteorlog/dsl/context.rb', line 15

def initialize(path, options = {}, &block)
  @path = path
  @options = options
  @result = OpenStruct.new(:log_groups => [])
  @log_group_names = []
  instance_eval(&block)
end

Instance Attribute Details

#resultObject (readonly)

of class methods



13
14
15
# File 'lib/meteorlog/dsl/context.rb', line 13

def result
  @result
end

Class Method Details

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



6
7
8
9
10
# File 'lib/meteorlog/dsl/context.rb', line 6

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