Class: DNSimple::Commands::ListRecords
- Inherits:
-
Object
- Object
- DNSimple::Commands::ListRecords
- Defined in:
- lib/dnsimple/commands/list_records.rb
Instance Method Summary collapse
Instance Method Details
#execute(args, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/dnsimple/commands/list_records.rb', line 4 def execute(args, ={}) domain_name = args.shift records = Record.all(domain_name) puts "Found #{records.length} records for #{domain_name}" 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.domain.name} (#{record.record_type})-> #{record.content} #{extra}" end end |