Class: DNSimple::Commands::AddTemplateRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/dnsimple/commands/add_template_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/add_template_record.rb', line 4

def execute(args, options={})
  short_name = args.shift
  record_name = args.shift
  record_type = args.shift
  content = args.shift
  ttl = args.shift

  template = Template.find(short_name)
  record = TemplateRecord.create(template.short_name, record_name, record_type, content, :ttl => ttl, :prio => options[:prio])
  
  puts "Created #{record.record_type} with content '#{record.content}' record for template #{template.name}"
end