class Caren::Store::AccountEntry < Caren::Base def self.keys [:id, # Integer (Caren id) :account_id, # Integer (Caren account id) :amount, # Integer (Delta amount in credits, unit depends on account billable) :reserved, # Boolean (Is this a reservation) :source_id, # Integer (Source of the account entry, Caren object id) :source_type, # String (Source of the account entry, Caren object class string) :external_source_id # Integer (Source of the account entry, Your object id, if known) ] + super end def self.find account_id, id, session from_xml session.get(self.resource_url(account_id,id)) end def self.all account_id, session from_xml session.get(self.resource_url(account_id)) end def self.array_root :account_entries end def self.node_root :account_entry end def self.resource_location "/api/pro/store/account/%i/account_entries" end private def resource_url account_id, id=nil self.class.resource_url(account_id,id) end def self.resource_url account_id, id=nil "#{self.resource_location % account_id}#{id}" end end