Class: Intercom::Service::Conversation
Instance Attribute Summary
Attributes inherited from BaseService
#client
Instance Method Summary
collapse
#create, #identity_hash, #save
#load
#find
#find_all
Methods inherited from BaseService
#from_api, #initialize
Instance Method Details
#collection_class ⇒ Object
15
16
17
|
# File 'lib/intercom/service/conversation.rb', line 15
def collection_class
Intercom::Conversation
end
|
#mark_read(id) ⇒ Object
19
20
21
|
# File 'lib/intercom/service/conversation.rb', line 19
def mark_read(id)
@client.put("/conversations/#{id}", read: true)
end
|
#reply(reply_data) ⇒ Object
23
24
25
26
27
28
|
# File 'lib/intercom/service/conversation.rb', line 23
def reply(reply_data)
id = reply_data.delete(:id)
collection_name = Utils.resource_class_to_collection_name(collection_class)
response = @client.post("/#{collection_name}/#{id}/reply", reply_data.merge(:conversation_id => id))
collection_class.new.from_response(response)
end
|