Class: Unresponsys::Event
- Extended by:
- Forwardable
- Defined in:
- lib/unresponsys/event.rb
Instance Attribute Summary collapse
-
#member ⇒ Object
readonly
Returns the value of attribute member.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Event
constructor
A new instance of Event.
- #save ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Event
Returns a new instance of Event.
7 8 9 10 |
# File 'lib/unresponsys/event.rb', line 7 def initialize( = {}) @event_name = [:event] @member = [:member] end |
Instance Attribute Details
#member ⇒ Object (readonly)
Returns the value of attribute member.
5 6 7 |
# File 'lib/unresponsys/event.rb', line 5 def member @member end |
Instance Method Details
#save ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/unresponsys/event.rb', line 12 def save body = { customEvent: {}, recipientData: [{ recipient: { listName: { objectName: @member.list.name }, recipientId: @member.riid } }] } r = client.post("/events/#{@event_name}", body: body.to_json) return false if r.first['errorMessage'].present? true end |