Sha256: ffb631713e0c756f1a12d4255b85ef5f929e95c2b9b5dd9db9526920f9150b2a

Contents?: true

Size: 566 Bytes

Versions: 19

Compression:

Stored size: 566 Bytes

Contents

module DNSimple
  module Commands
    class CreateContact
      # Execute the contact:create command.
      # 
      # Args expected to be:
      # [name:value name:value ...]
      def execute(args, options={})
        attributes = {}
        attributes['state_province_choice'] = 'S'
        args.each do |arg|
          name, value = arg.split(":")
          attributes[Contact.resolve(name)] = value
        end

        contact = Contact.create(attributes, options)
        puts "Created contact #{contact.name} (id: #{contact.id})"
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
dnsimple-ruby-1.3.2 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.3.1 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.3.0 lib/dnsimple/commands/create_contact.rb
sparqcode-dnsimple-ruby-1.2.6 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.6 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.5 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.4 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.3 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.2 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.1 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.2.0 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.1.1 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-1.0.0 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-0.9.9 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-0.9.8 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-0.9.7 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-0.9.6 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-0.9.5 lib/dnsimple/commands/create_contact.rb
dnsimple-ruby-0.9.4 lib/dnsimple/commands/create_contact.rb