Sha256: 3b54669cabfa3277e8df115092c095ad0c7a6d49fff6d4a348d4794a33e53d8d
Contents?: true
Size: 636 Bytes
Versions: 10
Compression:
Stored size: 636 Bytes
Contents
module DNSimple module Commands class ContactUpdate # Execute the contact:update command. # # Args expected: # id [name:value name:value ...] def execute(args, options = {}) attributes = {} id = args.shift args.each do |arg| name, value = arg.split(":") attributes[Contact.resolve(name)] = value end contact = Contact.find(id) attributes.each do |name, value| contact.send("#{name}=", value) end contact.save puts "Updated contact #{contact.name} (id: #{contact.id})" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems