Class: DNSimple::Commands::CreateContact
- Inherits:
-
Object
- Object
- DNSimple::Commands::CreateContact
- Defined in:
- lib/dnsimple/commands/create_contact.rb
Instance Method Summary collapse
-
#execute(args, options = {}) ⇒ Object
Execute the contact:create command.
Instance Method Details
#execute(args, options = {}) ⇒ Object
Execute the contact:create command.
Args expected to be:
- name:value name:value …
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/dnsimple/commands/create_contact.rb', line 8 def execute(args, ={}) attributes = {} attributes['state_province_choice'] = 'S' args.each do |arg| name, value = arg.split(":") attributes[Contact.resolve(name)] = value end contact = Contact.create(attributes, ) puts "Created contact #{contact.name} (id: #{contact.id})" end |