Class: Jisota::Configuration::DSL

Inherits:
DSLBase
  • Object
show all
Defined in:
lib/jisota/configuration.rb

Instance Method Summary collapse

Methods inherited from DSLBase

#evaluate, #method_missing

Constructor Details

#initialize(target) ⇒ DSL

Returns a new instance of DSL.



43
44
45
# File 'lib/jisota/configuration.rb', line 43

def initialize(target)
  @target = target
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Jisota::DSLBase

Instance Method Details

#package(name, &block) ⇒ Object



47
48
49
# File 'lib/jisota/configuration.rb', line 47

def package(name, &block)
   @target.packages << Package.new(name, &block)
end

#role(name, &block) ⇒ Object



51
52
53
# File 'lib/jisota/configuration.rb', line 51

def role(name, &block)
  @target.roles << Role.new(name, &block)
end

#server(host, options = {}) ⇒ Object



55
56
57
# File 'lib/jisota/configuration.rb', line 55

def server(host, options = {})
  @target.servers << Server.new(host, options)
end