Sha256: 49e4651d435ab1e920f7e6a1b81416d4f774ab6b15e85a660fe8d3082443d660

Contents?: true

Size: 606 Bytes

Versions: 10

Compression:

Stored size: 606 Bytes

Contents

module DNSimple
  module Commands
    class TemplateRecordList
      def execute(args, options = {})
        short_name = args.shift
        template_records = TemplateRecord.all(short_name)
        puts "Found #{template_records.length} records for #{short_name}"
        template_records.each do |record|
          extra = ["ttl:#{record.ttl}", "id:#{record.id}"]
          extra << "prio:#{record.prio}" if record.record_type == "MX"
          extra = "(#{extra.join(', ')})"
          puts "\t#{record.name} (#{record.record_type})-> #{record.content} #{extra}"
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dnsimple-ruby-1.7.1 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.7.0 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.6.0 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.5.5 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.5.4 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.5.3 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.5.2 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.5.1 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.4.1 lib/dnsimple/commands/template_record_list.rb
dnsimple-ruby-1.4.0 lib/dnsimple/commands/template_record_list.rb