Class: YourMembership::Sa::Member

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

Overview

YourMembership System Administrator Member 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

.certifications_get(member_id, options = {}) ⇒ Array

Returns a list of Certifications for the specified user.

Parameters:

  • member_id (Integer)

    ID of the person whose certifications to return.

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :IsArchived (Boolean)

    Include archived certification records in the returned result. Def: True

Returns:

  • (Array)

    Returns an array of Hashes representing a member’s certifications

See Also:



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

def self.certifications_get(member_id, options = {})
  options[:ID] = member_id

  response = post('/', :body => build_XML_request('Sa.Member.Certifications.Get', nil, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Sa.Member.Certifications.Get'], ['Certification']
end

.certifications_journal_get(member_id, options = {}) ⇒ Array

Returns a list of Certification Journal Entries for the specified user that may be optionally filtered by date, expiration, and paging.

Parameters:

  • member_id (Integer)

    ID of the person whose certifications to return.

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :ShowExpired (Boolean)

    Include expired journal entries in the returned result.

  • :StartDate (DateTime)

    Only include Journal Entries that are newer that the supplied date.

  • :EntryID (Integer)

    Filter the returned results by sequential EntryID. Only those Certification Journals which have an EntryID greater than the supplied integer will be returned.

  • :CertificationID (String)

    Filter the Journal Entries returned by the specified Certification ID.

  • :PageSize (Integer)

    The number of items that are returned per call of this method. Default is 200 entries.

  • :PageNumber (Integer)

    PageNumber can be used to retrieve multiple result sets. Page 1 is returned by default.

Returns:

  • (Array)

    Returns an array of Hashes representing a member’s certification journal entries.

See Also:



39
40
41
42
43
44
45
46
# File 'lib/your_membership/sa_member.rb', line 39

def self.certifications_journal_get(member_id, options = {})
  options[:ID] = member_id

  response = post('/', :body => build_XML_request('Sa.Member.Certifications.Journal.Get', nil, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Sa.Member.Certifications.Journal.Get'], ['Entry']
end