Module: Intercom::ApiOperations::Save
- Included in:
- Company, Conversation, Event, Message, Note, Segment, Subscription, Tag, User
- Defined in:
- lib/intercom/api_operations/save.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
15 16 17 |
# File 'lib/intercom/api_operations/save.rb', line 15 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#save ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/intercom/api_operations/save.rb', line 19 def save collection_name = Utils.resource_class_to_collection_name(self.class) if id_present? && !posted_updates? response = Intercom.put("/#{collection_name}/#{id}", to_submittable_hash) else response = Intercom.post("/#{collection_name}", to_submittable_hash.merge(identity_hash)) end from_response(response) if response # may be nil we received back a 202 end |