lib/rubber/dns/zerigo.rb
def hosts_to_opts(hosts)
        opts = {}
        
        hosts.each do |host|
          opts[:host] ||= host.name || ''
          opts[:domain] ||= host.zone.domain
          opts[:type] ||= host.type
          opts[:ttl] ||= host.ttl.to_i if host.ttl
          
          opts[:data] ||= []
          if host.type =~ /MX/i
            opts[:data] << {:priority => host.priority, :value => host.value}
          else
            opts[:data] << host.value
          end
        end

        opts
      end
# multiple hosts with same name/type convert to a single rubber-dns.yml opts format
multiple hosts with same name/type convert to a single rubber-dns.yml opts format
multiple hosts with same name / type convert to a single rubber - dns . yml opts format
def hosts_to_opts(hosts)
        opts = {}
        hosts.each do |host|
          opts[:host] ||= host.name || ''
          opts[:domain] ||= host.zone.domain
          opts[:type] ||= host.type
          opts[:ttl] ||= host.ttl.to_i if host.ttl
          opts[:data] ||= []
          if host.type =~ /MX/i
            opts[:data] << {:priority => host.priority, :value => host.value}
          else
            opts[:data] << host.value
          end
        end
        opts
      end
def hosts_to_opts ( hosts ) opts = { } hosts . each do | host | opts [ :host ] ||= host . name || '' opts [ :domain ] ||= host . zone . domain opts [ :type ] ||= host . type opts [ :ttl ] ||= host . ttl . to_i if host . ttl opts [ :data ] ||= [ ] if host . type =~ / MX /i opts [ :data ] << { :priority => host . priority , :value => host . value } else opts [ :data ] << host . value end end opts end
multiple hosts with same name/type convert to a single rubber-dns.yml opts format
multiple hosts with same name / type convert to a single rubber - dns . yml opts format
hosts