class Dslimple::Zone
Attributes
name[R]
records[RW]
Public Class Methods
new(name)
click to toggle source
# File lib/dslimple/zone.rb, line 8 def initialize(name) @name = name @records = [] end
Public Instance Methods
==(other)
click to toggle source
# File lib/dslimple/zone.rb, line 13 def ==(other) other.is_a?(self.class) && hash == other.hash && records.hash == other.records.hash end
===(other)
click to toggle source
# File lib/dslimple/zone.rb, line 17 def ===(other) other.is_a?(self.class) && hash == other.hash end
clean_records(ignores)
click to toggle source
# File lib/dslimple/zone.rb, line 37 def clean_records(ignores) ignores = [ignores].flatten.map(&:to_s) records.select do |record| next false if ignores.include?('system') && record.system_record? next false if ignores.include?('child') && record.child_record? true end end
hash()
click to toggle source
# File lib/dslimple/zone.rb, line 21 def hash [name, records.map(&:hash)].hash end
to_dsl(options = {})
click to toggle source
# File lib/dslimple/zone.rb, line 29 def to_dsl(options = {}) <<DSL zone #{name.inspect} do #{clean_records(options[:ignore]).map { |record| record.to_dsl(options) }.join("\n\n")} end DSL end
to_s()
click to toggle source
# File lib/dslimple/zone.rb, line 25 def to_s name end