Class: Caren::Person
- Inherits:
-
Base
- Object
- Base
- Caren::Person
show all
- Defined in:
- lib/caren/person.rb
Instance Attribute Summary
Attributes inherited from Base
#attributes, #original_xml
Class Method Summary
collapse
Methods inherited from Base
#as_xml, 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
24
25
26
|
# File 'lib/caren/person.rb', line 24
def self.all session
from_xml session.get(self.resource_url)
end
|
.array_root ⇒ Object
28
29
30
|
# File 'lib/caren/person.rb', line 28
def self.array_root
:people
end
|
.find(id, session) ⇒ Object
20
21
22
|
# File 'lib/caren/person.rb', line 20
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
|
# File 'lib/caren/person.rb', line 3
def self.keys
[:id, :first_name, :last_name, :male, :email, :photo, :link_id, :external_id, :citizen_service_number ] + super
end
|
.node_root ⇒ Object
32
33
34
|
# File 'lib/caren/person.rb', line 32
def self.node_root
:person
end
|
.resource_location ⇒ Object
36
37
38
|
# File 'lib/caren/person.rb', line 36
def self.resource_location
"/api/pro/people"
end
|
.search(key, value, session) ⇒ Object
16
17
18
|
# File 'lib/caren/person.rb', line 16
def self.search key, value, session
from_xml session.get( self.search_url(key,value) )
end
|