Class: Ey::Core::Client::Message
- Extended by:
- Associations
- Defined in:
- lib/ey-core/models/message.rb
Instance Attribute Summary collapse
-
#request_id ⇒ Object
Returns the value of attribute request_id.
Instance Method Summary collapse
Methods included from Associations
assoc_accessor, assoc_coverage, assoc_reader, assoc_writer, associations, collection_reader
Methods inherited from Model
#destroy, range_parser, #save, #to_s, #update!, #url
Instance Attribute Details
#request_id ⇒ Object
Returns the value of attribute request_id.
9 10 11 |
# File 'lib/ey-core/models/message.rb', line 9 def request_id @request_id end |
Instance Method Details
#save! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ey-core/models/message.rb', line 11 def save! params = { "message" => self., "url" => self.collection.url, } if self.request_id params["url"] = self.connection.url_for("/requests/#{self.request_id}/messages") end if new_record? = self.collection.new(self.connection.(params).body["message"]) merge_attributes(.attributes) else raise NotImplementedError end end |