Class: YourMembership::Events

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

Overview

YourMembership Events Namespace

Class Method Summary collapse

Methods inherited from Base

build_XML_request, new_call_id, response_to_array, response_to_array_of_hashes, response_valid?, response_ym_error?

Class Method Details

.all_search(session, options = {}) ⇒ Array

Returns a list of Community Events based on the supplied search term.

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 events based on a search result.

See Also:



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

def self.all_search(session, options = {})
  # Options include :SearchText(String), :PageSize(Integer), :StartRecord(Integer)

  response = post('/', :body => build_XML_request('Events.All.Search', session, options))

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

.event_attendees_get(session, event_id) ⇒ Array

Returns a list of all Attendees for the specified event including both Registrations and RSVPs. If the Event Registration contains a related Custom Form, the form data will be included in the element as it is stored in our database. Records for authenticated members also include the element to cross reference the Member's data.

Parameters:

Returns:

  • (Array)

    Returns an Array of Hashes representing the attendees to a specific event.

See Also:



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

def self.event_attendees_get(session, event_id)
  options = {}
  options[:EventID] = event_id

  response = post('/', :body => build_XML_request('Events.Event.Attendees.Get', session, options))

  response_valid? response
  response_to_array_of_hashes response['YourMembership_Response']['Events.Event.Attendees.Get'], ['Attendees', 'Attendee']
end

.event_get(session, event_id) ⇒ Hash

Returns details about the provided Event ID.

Parameters:

Returns:

  • (Hash)

    Returns a Hash of details about a particular event.

See Also:



50
51
52
53
54
55
56
57
58
# File 'lib/your_membership/events.rb', line 50

def self.event_get(session, event_id)
  options = {}
  options[:EventID] = event_id

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

  response_valid? response
  response['YourMembership_Response']['Events.Event.Get'].to_h
end