Class: Caren::Employee
- Inherits:
-
Base
- Object
- Base
- Caren::Employee
show all
- Defined in:
- lib/caren/employee.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes, #original_xml
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
from_xml, hash_from_image, init_dependent_objects, #initialize, #node_root, #resource_url, resource_url, search_url, #to_xml, to_xml
Constructor Details
This class inherits a constructor from Caren::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Caren::Base
Class Method Details
.all(session) ⇒ Object
28
29
30
|
# File 'lib/caren/employee.rb', line 28
def self.all session
from_xml session.get(self.resource_url)
end
|
.array_root ⇒ Object
40
41
42
|
# File 'lib/caren/employee.rb', line 40
def self.array_root
:employees
end
|
.find(id, session) ⇒ Object
24
25
26
|
# File 'lib/caren/employee.rb', line 24
def self.find id, session
from_xml session.get(self.resource_url(id))
end
|
.keys ⇒ Object
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/caren/employee.rb', line 3
def self.keys
[ :id, :external_id, :first_name, :last_name, :role, :agb_code, :edi_address, :male, :care_provider_id, :bio, :photo, :created_at, :updated_at ]
end
|
.node_root ⇒ Object
44
45
46
|
# File 'lib/caren/employee.rb', line 44
def self.node_root
:employee
end
|
.resource_location ⇒ Object
48
49
50
|
# File 'lib/caren/employee.rb', line 48
def self.resource_location
"/api/pro/employees"
end
|
.search(key, value, session) ⇒ Object
20
21
22
|
# File 'lib/caren/employee.rb', line 20
def self.search key, value, session
from_xml session.get( self.search_url(key,value) )
end
|
Instance Method Details
#as_xml ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/caren/employee.rb', line 32
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
|