Sha256: f6ad2adcee9d064ebeb7bf3d79dc08d78b4312f31cf2817219604e6d290ff5d4
Contents?: true
Size: 634 Bytes
Versions: 29
Compression:
Stored size: 634 Bytes
Contents
module DNSimple module Commands class UpdateContact # 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
29 entries across 29 versions & 2 rubygems