Class: Kelbim::DSL

Inherits:
Object
  • Object
show all
Includes:
TemplateHelper
Defined in:
lib/kelbim/dsl.rb,
lib/kelbim/dsl/ec2.rb,
lib/kelbim/dsl/checker.rb,
lib/kelbim/dsl/listener.rb,
lib/kelbim/dsl/converter.rb,
lib/kelbim/dsl/listeners.rb,
lib/kelbim/dsl/attributes.rb,
lib/kelbim/dsl/health-check.rb,
lib/kelbim/dsl/load-balancer.rb

Defined Under Namespace

Modules: Checker Classes: Converter, EC2

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TemplateHelper

#context, #include_template

Constructor Details

#initialize(path, &block) ⇒ DSL

Returns a new instance of DSL.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/kelbim/dsl.rb', line 19

def initialize(path, &block)
  @path = path
  @result = OpenStruct.new(:ec2s => {})

  @context = Hashie::Mash.new(
    :path => path,
    :templates => {}
  )

  instance_eval(&block)
end

Instance Attribute Details

#resultObject (readonly)

of class methods



17
18
19
# File 'lib/kelbim/dsl.rb', line 17

def result
  @result
end

Class Method Details

.convert(exported, instance_names) ⇒ Object



12
13
14
# File 'lib/kelbim/dsl.rb', line 12

def convert(exported, instance_names)
  Converter.convert(exported, instance_names)
end

.define(source, path) ⇒ Object



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

def define(source, path)
  self.new(path) do
    eval(source, binding, path)
  end
end