Module: Unloq::Events
- Included in:
- Client
- Defined in:
- lib/unloq/events.rb
Instance Method Summary collapse
-
#create_event(author, verb, recipient, meta = {}) ⇒ Object
Create an event via the Unloq API.
-
#lookup_event(author, verb, recipient) ⇒ Object
Lookup an event via the Unloq API.
Instance Method Details
#create_event(author, verb, recipient, meta = {}) ⇒ Object
Create an event via the Unloq API
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/unloq/events.rb', line 11 def create_event , verb, recipient, = {} () validate_recipient(recipient) body_to_post = { author_id: .id, author_type: .type, recipient_id: recipient.id, recipient_type: recipient.type, verb: verb, meta: } post('/events', body_to_post) end |
#lookup_event(author, verb, recipient) ⇒ Object
Lookup an event via the Unloq API
33 34 35 36 37 38 |
# File 'lib/unloq/events.rb', line 33 def lookup_event , verb, recipient () validate_recipient(recipient) get('/events', "/#{.type}/#{.id}/#{verb}/#{recipient.type}/#{recipient.id}") end |