lib/tinydns/record.rb in tinydns-data-0.0.1 vs lib/tinydns/record.rb in tinydns-data-0.0.2
- old
+ new
@@ -5,18 +5,39 @@
self[k] = v
end
end
def type
- self[:type]
+ case self[:type]
+ when "C"
+ :cname
+ when "="
+ :a
+ when "@"
+ :mx
+ when "."
+ :soa
+ when "'"
+ :text
+ else
+ self[:type]
+ end
end
def name
self[:name]
end
+ def value
+ self[:value]
+ end
+
+ def ttl
+ self[:ttl]
+ end
+
def to_str
- str = "#{type}#{name}:#{self[:value]}:#{self[:ttl]}"
+ str = "#{self[:type]}#{name}:#{value}:#{ttl}"
if self[:other]
str << ":#{self[:other]}"
end
str
end