Sha256: 3398d02e3dce8360dadd0f480975414b581e7520ef1806b49de98729e3dd3f66

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

class Caren::Employee < Caren::Base

  def self.keys
    [ :id,               # Integer (Caren id, if applicable)
      :external_id,      # String (Your employee id)
      :first_name,       # String
      :last_name,        # String
      :role,             # String
      :agb_code,         # String
      :edi_address,      # String
      :male,             # Boolean
      :care_provider_id, # Integer
      :bio,              # Text
      :photo,            # String
      :created_at,       # Datetime
      :updated_at        # Datetime
    ]
  end

  def self.search key, value, session
    from_xml session.get( self.search_url(key,value) )
  end

  def self.find id, session
    from_xml session.get(self.resource_url(id))
  end

  def self.all session
    from_xml session.get(self.resource_url)
  end

  def as_xml
    { :external_id => self.external_id,
      :first_name => self.first_name,
      :last_name => self.last_name,
      :bio => self.bio,
      :photo => self.photo }
  end

  def self.array_root
    :employees
  end

  def self.node_root
    :employee
  end

  def self.resource_location
    "/api/pro/employees"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
caren-api-0.12.5 lib/caren/employee.rb
caren-api-0.12.4 lib/caren/employee.rb
caren-api-0.12.3 lib/caren/employee.rb