Class: DNS::Zonefile::Record
- Inherits:
-
Object
- Object
- DNS::Zonefile::Record
- Defined in:
- lib/dns/zonefile.rb
Instance Attribute Summary collapse
- #klass ⇒ Object
-
#ttl ⇒ Object
readonly
Returns the value of attribute ttl.
Class Method Summary collapse
-
.inheriting_writer_for_at(*attribs) ⇒ Object
assign, with handling for ‘@’, with inheritance.
-
.writer_for_at(*attribs) ⇒ Object
assign, with handling for ‘@’.
-
.writer_for_ttl(*attribs) ⇒ Object
assign, with handling for global TTL.
Instance Attribute Details
#klass ⇒ Object
115 116 117 118 |
# File 'lib/dns/zonefile.rb', line 115 def klass @klass = nil if @klass == '' @klass ||= 'IN' end |
#ttl ⇒ Object (readonly)
Returns the value of attribute ttl.
111 112 113 |
# File 'lib/dns/zonefile.rb', line 111 def ttl @ttl end |
Class Method Details
.inheriting_writer_for_at(*attribs) ⇒ Object
assign, with handling for ‘@’, with inheritance
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/dns/zonefile.rb', line 84 def self.inheriting_writer_for_at(*attribs) attribs.each do |attrib| c = <<-MTH def #{attrib}=(val) if val.strip.empty? @#{attrib} = @vars[:last_host] else @#{attrib} = val.gsub('@', @vars['origin']) end end MTH class_eval c, __FILE__, __LINE__ end end |
.writer_for_at(*attribs) ⇒ Object
assign, with handling for ‘@’
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/dns/zonefile.rb', line 72 def self.writer_for_at(*attribs) attribs.each do |attrib| c = <<-MTH def #{attrib}=(val) @#{attrib} = val.gsub('@', @vars['origin']) end MTH class_eval c, __FILE__, __LINE__ end end |
.writer_for_ttl(*attribs) ⇒ Object
assign, with handling for global TTL
100 101 102 103 104 105 106 107 108 109 |
# File 'lib/dns/zonefile.rb', line 100 def self.writer_for_ttl(*attribs) attribs.each do |attrib| c = <<-MTH def #{attrib}=(val) @#{attrib} = val || @vars['ttl'] end MTH class_eval c, __FILE__, __LINE__ end end |