Method: PlateApi::PlateObject::Base#update
- Defined in:
- lib/plate_api/plate_object/base.rb
#update(attributes) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/plate_api/plate_object/base.rb', line 26 def update(attributes) raise ArgumentError, "Input `attributes` is not a Hash" unless attributes.is_a?(Hash) raise ArgumentError, "No object_handler is attached to this object" unless @object_handler if new_object = @object_handler.update(@id, attributes) reinitialize(new_object) else raise ArgumentError, "The update was unsuccesful." end self end |