def update record, resources
      result = [resources].flatten.map do |resource|
        resource = record.new(resource) unless resource.kind_of?(record)
        keys     = resource.tuple.values_at(*record.header.keys)

        # TODO: Name the key field(s) missing.
        raise ArgumentError, "#{record} resource has incomplete key: #{resource.inspect}" \
          unless keys.select(&:nil?).empty?

        execute(command_update(record), *resource.tuple.values_at(*record.header.updatable), *keys)
        resource
      end
      resources.kind_of?(Array) ? result : result.first
    end
def update record, resources
      result = [resources].flatten.map do |resource|
        resource = record.new(resource) unless resource.kind_of?(record)
        keys     = resource.tuple.values_at(*record.header.keys)

        # TODO: Name the key field(s) missing.
        raise ArgumentError, "#{record} resource has incomplete key: #{resource.inspect}" \
          unless keys.select(&:nil?).empty?

        execute(command_update(record), *resource.tuple.values_at(*record.header.updatable), *keys)
        resource
      end
      resources.kind_of?(Array) ? result : result.first
    end
Update one or more.

 @example Record.
   user      = Swift.db.create(User, name: 'Apply Arthurton', age: 32)
   user.name = 'Arthur Appleton'
   Swift.db.update(User, user)
   #=> Swift::Record
 @example Coerce hash to record.
   user      = Swift.db.create(User, name: 'Apply Arthurton', age: 32)
   user.name = 'Arthur Appleton'
   Swif.db.update(User, user.tuple)
   #=> Swift::Record
 @example Multiple resources.
   apple = Swift.db.create(User, name: 'Apple Arthurton', age: 32)
   benny = Swift.db.create(User, name: 'Benny Arthurton', age: 30)
   Swift.db.update(User, [apple, benny])
   #=> Array<Swift::Record>
 @example Coerce multiple resources.
   apple = Swift.db.create(User, name: 'Apple Arthurton', age: 32)
   benny = Swift.db.create(User, name: 'Benny Arthurton', age: 30)
   Swift.db.update(User, [apple.tuple, benny.tuple])
   #=> Array<Swift::Record>

 @param  [Swift::Record]                                   record    Concrete record subclass to load.
 @param  [Swift::Record, Hash, Array<Swift::Record, Hash>] resources The resources to be updated.
 @return [Swift::Record, Swift::Result]
 @note   Hashes will be coerced into a Swift::Record resource via Swift::Record#new
 @note   Passing a scalar will result in a scalar.
 @see    Swift::Record#update