Class: DNSimple::Commands::CreateRecord
- Inherits:
-
DNSimple::Command
- Object
- DNSimple::Command
- DNSimple::Commands::CreateRecord
- Defined in:
- lib/dnsimple/commands/create_record.rb
Instance Method Summary collapse
Methods inherited from DNSimple::Command
Constructor Details
This class inherits a constructor from DNSimple::Command
Instance Method Details
#execute(args, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/dnsimple/commands/create_record.rb', line 6 def execute(args, ={}) 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, record_name, record_type, content, :ttl => ttl, :prio => [:prio]) say "Created #{record.record_type} record for #{domain.name} (id:#{record.id})" end |