Class: YourMembership::People

Inherits:
Base
  • Object
show all
Defined in:
lib/your_membership/people.rb

Overview

YourMembership People Namespace

Class Method Summary collapse

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_search(session, options = {}) ⇒ Array

Returns paged results for a search request. Returns a maximum of 100 records per request.

Parameters:

Options Hash (options):

  • :SearchText (String)

    Text to be searched

  • :PageSize (Integer)

    The maximum number of records in the returned result set.

  • :StartRecord (Integer)

    The record number at which to start the returned result set.

Returns:

  • (Array)

    Returns an Array of Hashes representing search results

See Also:



14
15
16
17
18
19
# File 'lib/your_membership/people.rb', line 14

def self.all_search(session, options = {})
  response = post('/', :body => build_XML_request('People.All.Search', session, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['People.All.Search'], ['Results', 'Item']
end

.profile_get(session, id) ⇒ YourMembership::Profile

Returns a person’s profile data.

Parameters:

  • session (YourMembership::Session)
  • id (String)

    ID or ProfileID of the person’s whose profile data to return.

Returns:

See Also:



28
29
30
31
32
33
34
35
36
# File 'lib/your_membership/people.rb', line 28

def self.profile_get(session, id)
  options = {}
  options['ID'] = id

  response = post('/', :body => build_XML_request('People.Profile.Get', session, options))

  response_valid? response
  YourMembership::Profile.new response['YourMembership_Response']['People.Profile.Get']
end