Class: Timepad::Event
- Inherits:
-
Object
- Object
- Timepad::Event
- Defined in:
- lib/timepad/event.rb
Instance Method Summary collapse
-
#get(event_id) ⇒ Hash
Get event by event_id.
-
#initialize(timepad_client) ⇒ Event
constructor
A new instance of Event.
-
#list(attrs = {}) ⇒ Array
Get all events.
Constructor Details
#initialize(timepad_client) ⇒ Event
Returns a new instance of Event.
17 18 19 |
# File 'lib/timepad/event.rb', line 17 def initialize(timepad_client) @client = timepad_client end |
Instance Method Details
#get(event_id) ⇒ Hash
Get event by event_id
33 34 35 |
# File 'lib/timepad/event.rb', line 33 def get(event_id) @client.request "events/#{event_id}" end |
#list(attrs = {}) ⇒ Array
Get all events
25 26 27 |
# File 'lib/timepad/event.rb', line 25 def list(attrs = {}) response = @client.request 'events', attrs end |