Class: YourMembership::Sa::People
- Defined in:
- lib/your_membership/sa_people.rb
Overview
YourMembership System Administrator Members Namespace
Class Method Summary collapse
-
.all_getIDs(options = {}) ⇒ Array
Returns a list of member and non-member IDs that may be optionally filtered by timestamp.
-
.profile_findID(options = {}) ⇒ String, Array
Finds and returns a member or non-member <ID> using Import ID, Constituent ID or Website/Profile ID as criteria.
-
.profile_get(id) ⇒ YourMembership::Profile
Returns a person’s profile data.
-
.profile_groups_get(id) ⇒ Hash
Returns a person’s group relationship data.
-
.profile_update(id, profile) ⇒ Boolean
Updates an existing person’s profile.
Methods inherited from Base
build_XML_request, new_call_id, post, response_to_array, response_to_array_of_hashes, response_valid?, response_ym_error?
Class Method Details
.all_getIDs(options = {}) ⇒ Array
Returns a list of member and non-member IDs that may be optionally filtered by timestamp. This method is provided for data synchronization purposes and will return a maximum of 10,000 results. It would typically be used in conjunction with subsequent calls to Sa.People.Profile.Get for each ID returned
18 19 20 21 22 |
# File 'lib/your_membership/sa_people.rb', line 18 def self.all_getIDs( = {}) # rubocop:disable Style/MethodName response = post('/', :body => build_XML_request('Sa.People.All.GetIDs', nil, )) response_valid? response response['YourMembership_Response']['Sa.People.All.GetIDs']['People']['ID'] end |
.profile_findID(options = {}) ⇒ String, Array
Finds and returns a member or non-member <ID> using Import ID, Constituent ID or Website/Profile ID as criteria. If a single ID cannot be uniquely identified based on the criteria supplied then error code 406 is returned.
39 40 41 42 43 |
# File 'lib/your_membership/sa_people.rb', line 39 def self.profile_findID( = {}) # rubocop:disable Style/MethodName response = post('/', :body => build_XML_request('Sa.People.Profile.FindID', nil, )) response_valid? response response['YourMembership_Response']['Sa.People.Profile.FindID']['ID'] end |
.profile_get(id) ⇒ YourMembership::Profile
Returns a person’s profile data.
51 52 53 54 55 56 57 |
# File 'lib/your_membership/sa_people.rb', line 51 def self.profile_get(id) = {} [:ID] = id response = post('/', :body => build_XML_request('Sa.People.Profile.Get', nil, )) response_valid? response YourMembership::Profile.new response['YourMembership_Response']['Sa.People.Profile.Get'] end |
.profile_groups_get(id) ⇒ Hash
Returns a person’s group relationship data. There are three types of relationships that members may have with particular groups; “Administrator”, “Member” and “Representative”. Groups are listed within nodes respective of their relationship type.
67 68 69 70 71 72 73 74 |
# File 'lib/your_membership/sa_people.rb', line 67 def self.profile_groups_get(id) = {} [:ID] = id response = post('/', :body => build_XML_request('Sa.People.Profile.Groups.Get', nil, )) response_valid? response response['YourMembership_Response']['Sa.People.Profile.Groups.Get'] end |
.profile_update(id, profile) ⇒ Boolean
Updates an existing person’s profile.
83 84 85 86 87 88 89 |
# File 'lib/your_membership/sa_people.rb', line 83 def self.profile_update(id, profile) = {} ['ID'] = id ['profile'] = profile response = post('/', :body => build_XML_request('Sa.People.Profile.Update', nil, )) response_valid? response end |