Class: Riptables::DSL::Base

Inherits:
Global
  • Object
show all
Defined in:
lib/riptables/dsl/base.rb

Instance Method Summary collapse

Methods inherited from Global

#role, #zone

Constructor Details

#initialize(base, &block) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/riptables/dsl/base.rb', line 9

def initialize(base, &block)
  @base = base
end

Instance Method Details

#host_group(name, &block) ⇒ Object



19
20
21
22
23
# File 'lib/riptables/dsl/base.rb', line 19

def host_group(name, &block)
  host_group = Riptables::HostGroup.new(@base, name)
  host_group.dsl.instance_eval(&block)
  @base.host_groups[name] = host_group
end

#load(name) ⇒ Object



25
26
27
# File 'lib/riptables/dsl/base.rb', line 25

def load(name)
  @base.load_from_file(File.expand_path(name))
end

#table(name, &block) ⇒ Object



13
14
15
16
17
# File 'lib/riptables/dsl/base.rb', line 13

def table(name, &block)
  table = Riptables::Table.new(@base, name)
  table.dsl.instance_eval(&block)
  @base.tables << table
end