Class: Splicer::Zone
- Inherits:
-
Object
- Object
- Splicer::Zone
- Defined in:
- lib/splicer/zone.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#ttl ⇒ Object
Returns the value of attribute ttl.
Instance Method Summary collapse
-
#add_record(record) ⇒ Boolean
Adds a single record to this zone.
-
#add_records(records) ⇒ Boolean
Adds a set of records to this zone.
-
#initialize(name, ttl = 3600) ⇒ Zone
constructor
A new instance of Zone.
Constructor Details
#initialize(name, ttl = 3600) ⇒ Zone
Returns a new instance of Zone.
9 10 11 12 13 |
# File 'lib/splicer/zone.rb', line 9 def initialize(name, ttl=3600) @name = name @ttl = ttl @records = Array.new end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/splicer/zone.rb', line 4 def name @name end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
6 7 8 |
# File 'lib/splicer/zone.rb', line 6 def records @records end |
#ttl ⇒ Object
Returns the value of attribute ttl.
4 5 6 |
# File 'lib/splicer/zone.rb', line 4 def ttl @ttl end |
Instance Method Details
#add_record(record) ⇒ Boolean
Adds a single record to this zone
17 18 19 20 21 |
# File 'lib/splicer/zone.rb', line 17 def add_record(record) return false unless record.is_a?(Splicer::Records::Record) @records.push(record) true end |
#add_records(records) ⇒ Boolean
Adds a set of records to this zone
25 26 27 |
# File 'lib/splicer/zone.rb', line 25 def add_records(records) records.each { |r| add_record(r) } end |