Sha256: 9c30ba57f694c830c243735a7839757cfbc61672b87617ac1ca6efa017b2af87
Contents?: true
Size: 1.72 KB
Versions: 12
Compression:
Stored size: 1.72 KB
Contents
# This class is just an intermediate for exporting events to Caren. # It has the correct format for exports. class Caren::Event < Caren::Base def self.keys [ :id, # Integer (Caren id, optional) :external_id, # String Unique identifying string (Your event id) :name, # String :comment, # String :start, # String (14:00) :duration, # Integer :reservation, # Integer :valid_from, # Date :valid_to, # Date :person_first_name, # String :person_last_name, # String :person_male, # Boolean :billable_id, # Integer (Caren billable id) :billable_amount, # Integer :cancel_before, # DateTime :subject_id, # Integer (Caren subject id) :external_person_id,# String (Your person id) :source # String (remote_schedule,remote_realisation) ] + super end def self.all session from_xml session.get(self.resource_url) end def self.find id, session from_xml session.get(self.resource_url(id)) end def create session self.class.from_xml session.post self.class.resource_url, self.to_xml end def charge session self.class.from_xml session.post self.class.charge_url(self.id), self.to_xml end def update session self.class.from_xml session.put self.class.resource_url(self.id), self.to_xml end def delete session session.delete self.class.resource_url(self.id) end def self.array_root :events end def self.node_root :event end def self.charge_url id=nil "#{resource_location}/#{id}/charge" end private def self.resource_location "/api/pro/events" end end
Version data entries
12 entries across 12 versions & 1 rubygems