Method: Evvnt::ClassTemplateMethods#update

Defined in:
lib/evvnt/class_template_methods.rb

#update(record_id, **params) ⇒ Object

Template method for updating a given record

record_id - An Integer or String representing the record ID on the API. params - A Hash of params to send to the API.

Returns Base subclass



54
55
56
57
58
59
60
# File 'lib/evvnt/class_template_methods.rb', line 54

def update(record_id, **params)
  if record_id.nil? && !singular_resource?
    raise ArgumentError, "record_id cannot be nil"
  end
  path = nest_path_within_parent(singular_path_for_record(record_id, params), params)
  api_request(:put, path, params: params)
end