Class Point::Base
In: lib/point/base.rb
Parent: Object

Methods

Attributes

attributes  [RW]   Store all attributes for the model we‘re working with.
errors  [RW]   Store all attributes for the model we‘re working with.
id  [RW]   Store all attributes for the model we‘re working with.

Public Class methods

Return the point class name

 Return the collection path for this model. Very lazy pluralizion here  at the moment, nothing in Point needs to be pluralized with anything  other than just adding an ‘s’.

Find a record or set of records. Passing :all will return all records and passing an integer will return the individual record for the ID passed.

 Find all objects and return an array of objects with the attributes set.

Find a single object and return an object for it.

Return the member path for the passed ID & attributes

 Post to the specified object on the collection path

Public Instance methods

Delete this record from the remote service. Returns true or false depending on the success status of the destruction.

 Pass any methods via. the attributes hash to see if they exist  before resuming normal method_missing behaviour

Run a post on the member path. Returns the ouput from the post, false if a conflict or raises a Point::Error. Optionally, pass a second ‘data’ parameter to send data to the post action.

 Push the updated attributes to the remote. Returns true if the record was saved successfully

 other false if not. If not saved successfully, the errors hash will be updated with an array

 of all errors with the submission.

[Validate]