Class: Arcticelvis::Event
Instance Attribute Summary collapse
-
#event_messages ⇒ Object
Returns the value of attribute event_messages.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
#initialize, #parse_timestamps, #set_attributes
Constructor Details
This class inherits a constructor from Arcticelvis::Base
Instance Attribute Details
#event_messages ⇒ Object
Returns the value of attribute event_messages.
3 4 5 |
# File 'lib/arcticelvis/event.rb', line 3 def end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/arcticelvis/event.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/arcticelvis/event.rb', line 3 def name @name end |
Class Method Details
.find(id) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/arcticelvis/event.rb', line 6 def find(id) response, status = Arcticelvis.request(:get, "events/#{id}", {}) raise RecordNotFoundError if status == 404 = response["event"]["event_messages"] response["event"].delete("event_messages") event = self.new(response["event"]) if res = [] .each do || res << Arcticelvis::EventMessage.new() end end event. = res if res event end |
Instance Method Details
#trigger(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/arcticelvis/event.rb', line 25 def trigger(={}) raise InvalidOptionsError.new("no email given") unless [:to] response, status = Arcticelvis.request(:post, "events/#{id}/trigger", ) raise RecordNotFoundError if status == 404 if status == 201 set_attributes(response["event_instance"]["event"]) return self end end |