Class: RIQ::Event
Overview
Events represent interactions involving a Contact associated with a List Item.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#subject ⇒ Object
Returns the value of attribute subject.
Attributes inherited from RIQObject
Class Method Summary collapse
-
.node ⇒ String
Endpoint.
Instance Method Summary collapse
- #add_participant(type, value) ⇒ Object
-
#data ⇒ Hash
All relevant stored data.
-
#node ⇒ String
Endpoint.
-
#participant_ids ⇒ Array
Immutable copy of participant_ids.
-
#save ⇒ Hash
Success message, if successful.
Methods inherited from RIQObject
#delete, #initialize, #payload
Constructor Details
This class inherits a constructor from RIQ::RIQObject
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
8 9 10 |
# File 'lib/riq/event.rb', line 8 def body @body end |
#subject ⇒ Object
Returns the value of attribute subject.
7 8 9 |
# File 'lib/riq/event.rb', line 7 def subject @subject end |
Class Method Details
.node ⇒ String
Returns endpoint.
17 18 19 |
# File 'lib/riq/event.rb', line 17 def self.node "events" end |
Instance Method Details
#add_participant(type, value) ⇒ Object
32 33 34 35 |
# File 'lib/riq/event.rb', line 32 def add_participant(type, value) raise RIQError, 'Type must be :email or :phone' unless [:email, :phone].include?(type) @participant_ids << {type: type, value: value} end |
#data ⇒ Hash
Returns all relevant stored data.
22 23 24 25 26 27 28 |
# File 'lib/riq/event.rb', line 22 def data { subject: @subject, body: @body, participant_ids: @participant_ids } end |
#node ⇒ String
Returns endpoint.
12 13 14 |
# File 'lib/riq/event.rb', line 12 def node self.class.node end |
#participant_ids ⇒ Array
Returns Immutable copy of participant_ids.
38 39 40 |
# File 'lib/riq/event.rb', line 38 def participant_ids @participant_ids.dup end |
#save ⇒ Hash
Returns Success message, if successful.
43 44 45 46 47 |
# File 'lib/riq/event.rb', line 43 def save # there are no options to pass for event save @client.put(node, payload, options: nil) {status: 204, message: 'No Content'} end |