Class: Timepad::Event

Inherits:
Base
  • Object
show all
Defined in:
lib/timepad/event.rb

Instance Method Summary collapse

Methods inherited from Base

#make_query, #make_uri, #request, #subscribers_to_hash

Constructor Details

#initialize(timepad_client) ⇒ Event

Returns a new instance of Event.



4
5
6
# File 'lib/timepad/event.rb', line 4

def initialize(timepad_client)
  @client = timepad_client
end

Instance Method Details

#create(attrs) ⇒ Array

Create event

Returns:

  • (Array)


38
39
40
# File 'lib/timepad/event.rb', line 38

def create(attrs)
  request 'create', attrs
end

#export(event_id, attrs = nil) ⇒ Array

Get event members

Returns:

  • (Array)


28
29
30
31
32
# File 'lib/timepad/event.rb', line 28

def export(event_id, attrs = nil)
  request_attrs = {:e_id => event_id}
  request_attrs.merge!(attrs) unless attrs.nil?
  request 'export', request_attrs
end

#get(event_id) ⇒ Array

Get event by event_id

Parameters:

  • event_id (String)

Returns:

  • (Array)


20
21
22
# File 'lib/timepad/event.rb', line 20

def get(event_id)
  request 'get', :e_id => event_id
end

#get_list(attrs = {}) ⇒ Array

Get all events

Parameters:

  • (Hash{cat_id => String, limit => String, order_by =>String})

Returns:

  • (Array)


12
13
14
# File 'lib/timepad/event.rb', line 12

def get_list(attrs = {})
  request 'getlist', attrs
end

#register(attrs) ⇒ Object

Register event member



46
47
48
# File 'lib/timepad/event.rb', line 46

def register(attrs)
  request 'register', attrs
end