Class: YourMembership::Members

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

Overview

YourMembership Members 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

.connections_categories_get(session, member_id) ⇒ Array

Note:

If you attempt to retrieve a member’s connection category list and they have not assigned any connections to categories an execption of type 406 from YourMembership.com ‘Method could not uniquely identify a record on which to operate’ will be raised.

Returns a member’s connection category list.

Parameters:

Returns:

  • (Array)

    Returns an Array of Hashes representing a member’s connection categories.

See Also:



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

def self.connections_categories_get(session, member_id)
  options = {}
  options[:ID] = member_id
  response = post('/', :body => build_XML_request('Members.Connections.Categories.Get', session, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Members.Connections.Categories.Get'], ['Category']
end

.connections_get(session, member_id, options = {}) ⇒ Array

Returns a member’s connection list, optionally filtered by category. Returns a maximum of 100 records per request.

Parameters:

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

    or ProfileID of the member’s connections to get.

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

Options Hash (options):

  • :CategoryID (Integer)

    Filter the returned results by connection category.

  • :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 a member’s connections.

See Also:



34
35
36
37
38
39
40
41
# File 'lib/your_membership/members.rb', line 34

def self.connections_get(session, member_id, options = {})
  options = {}
  options[:ID] = member_id
  response = post('/', :body => build_XML_request('Members.Connections.Get', session, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Members.Connections.Get'], ['Connection']
end

.mediaGallery_albums_get(session, member_id) ⇒ Array

TODO:

Contact YourMembership.com dev team to see if we’re doing this correctly.

Note:

BUG NOTED - This method seems to raise an exception on every call saying that Method Call Failed one or more elements is missing or invalid

Returns a member’s media gallery album list. The returned list will include <AlbumID>-1</AlbumID> which is a virtual album containing all of the member’s media gallery items.

Parameters:

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

    or ProfileID of the member whose media gallery albums to return.

Returns:

  • (Array)

    Returns an Array of Hashes representing a member’s albums.

See Also:



54
55
56
57
58
59
60
61
62
# File 'lib/your_membership/members.rb', line 54

def self.mediaGallery_albums_get(session, member_id) # rubocop:disable Style/MethodName
  options = {}
  options[:ID] = member_id
  # puts build_XML_request('Members.MediaGallery.Albums.Get', session, options)
  response = post('/', :body => build_XML_request('Members.MediaGallery.Albums.Get', session, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Members.MediaGallery.Albums.Get'], ['Album']
end

.mediaGallery_get(session, member_id, options = {}) ⇒ Array

Note:

If you attempt to retrieve a member’s gallery item list and they have no media an exception will be thrown of type 406 from YourMembership.com ‘Method could not uniquely identify a record on which to operate’

Returns a member’s media gallery item list, optionally filtered by album. Returns a maximum of 100 records per request.

Parameters:

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

    or ProfileID of the member whose media gallery to retrieve.

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

Options Hash (options):

  • :AlbumID (String)

    Filter the returned results by media gallery album.

  • :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 a member’s media items.

See Also:



78
79
80
81
82
83
84
85
# File 'lib/your_membership/members.rb', line 78

def self.mediaGallery_get(session, member_id, options = {}) # rubocop:disable Style/MethodName
  options = {}
  options[:ID] = member_id
  response = post('/', :body => build_XML_request('Members.MediaGallery.Get', session, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Members.MediaGallery.Get'], ['Item']
end

.mediaGallery_item_get(session, member_id, item_id) ⇒ Hash

Returns a single media gallery item.

Parameters:

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

    or ProfileID of the member whose media gallery item to return.

  • item_id (Integer)

    of the media gallery item to return.

Returns:

  • (Hash)

    Returns an Hash that represents a single media item.

See Also:



95
96
97
98
99
100
101
102
103
# File 'lib/your_membership/members.rb', line 95

def self.mediaGallery_item_get(session, member_id, item_id) # rubocop:disable Style/MethodName
  options = {}
  options[:ID] = member_id
  options[:ItemID] = item_id
  response = post('/', :body => build_XML_request('Members.MediaGallery.Item.Get', session, options))

  response_valid? response
  response['YourMembership_Response']['Members.MediaGallery.Item.Get']
end

.wall_get(session, member_id, options = {}) ⇒ Hash

Returns a member’s wall.

Parameters:

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

    ID or ProfileID of the member’s wall to get.

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

Options Hash (options):

  • :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:

  • (Hash)

    Returns a Hash representing the requested user’s wall.

See Also:



115
116
117
118
119
120
121
122
# File 'lib/your_membership/members.rb', line 115

def self.wall_get(session, member_id, options = {})
  options = {}
  options[:ID] = member_id
  response = post('/', :body => build_XML_request('Members.Wall.Get', session, options))

  response_valid? response
  response['YourMembership_Response']['Members.Wall.Get']
end