Class: Dslimple::DSL::Zone
- Inherits:
-
Object
- Object
- Dslimple::DSL::Zone
- Defined in:
- lib/dslimple/dsl/zone.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Zone
constructor
A new instance of Zone.
- #record(name = {}, options = {}, &block) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Zone
Returns a new instance of Zone.
7 8 9 10 11 12 |
# File 'lib/dslimple/dsl/zone.rb', line 7 def initialize(name, &block) @name = name @records = [] instance_eval(&block) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/dslimple/dsl/zone.rb', line 5 def name @name end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
5 6 7 |
# File 'lib/dslimple/dsl/zone.rb', line 5 def records @records end |
Instance Method Details
#record(name = {}, options = {}, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/dslimple/dsl/zone.rb', line 14 def record(name = {}, = {}, &block) if name.is_a?(Hash) = .merge(name) name = '' end = .merge(zone: @name, name: name) @records << Dslimple::DSL::Record.new(, &block) end |