Class: Unresponsys::Event

Inherits:
Object show all
Extended by:
Forwardable
Defined in:
lib/unresponsys/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Event

Returns a new instance of Event.



7
8
9
10
11
# File 'lib/unresponsys/event.rb', line 7

def initialize(options = {})
  @event_name = options[:event]
  @member     = options[:member]
  @properties = options[:properties]
end

Instance Attribute Details

#memberObject (readonly)

Returns the value of attribute member.



5
6
7
# File 'lib/unresponsys/event.rb', line 5

def member
  @member
end

Instance Method Details

#saveObject



13
14
15
16
17
18
# File 'lib/unresponsys/event.rb', line 13

def save
  build_body
  build_properties
  response = client.post("/events/#{@event_name}", body: @body.to_json)
  response.first['errorMessage'].blank?
end