Class: Riptables::DSL::Base
Instance Method Summary collapse
- #host_group(name, &block) ⇒ Object
-
#initialize(base, &block) ⇒ Base
constructor
A new instance of Base.
- #load(name) ⇒ Object
- #table(name, &block) ⇒ Object
Methods inherited from Global
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.(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 |