Class: DNSimple::Commands::CreateRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsimple/commands/create_record.rb

Instance Method Summary collapse

Instance Method Details

#execute(args, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/dnsimple/commands/create_record.rb', line 4

def execute(args, options={})
  name = args.shift
  record_name = args.shift
  record_type = args.shift
  content = args.shift
  ttl = args.shift
  
  domain = Domain.find(name)
  record = Record.create(domain.name, record_name, record_type, content, :ttl => ttl, :prio => options[:prio])
  
  puts "Created #{record.record_type} record for #{domain.name} (id:#{record.id})"
end