Class: Croesus::DSL

Inherits:
Object show all
Defined in:
lib/croesus/dsl/dsl.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ DSL

Returns a new instance of DSL.



27
28
29
# File 'lib/croesus/dsl/dsl.rb', line 27

def initialize(&block)
  instance_eval(&block)
end

Class Method Details

.evaluate(&block) ⇒ Object



22
23
24
25
# File 'lib/croesus/dsl/dsl.rb', line 22

def self.evaluate(&block)
  raise 'You need a block to build!' unless block_given?
  DSL.new(&block)
end

Instance Method Details

#resource(resource_name, &block) ⇒ Object



31
32
33
# File 'lib/croesus/dsl/dsl.rb', line 31

def resource(resource_name, &block)
  Croesus::ResourceDSL.new(resource_name, &block)
end