Class: Intercom::Service::Visitor
- Inherits:
-
BaseService
- Object
- BaseService
- Intercom::Service::Visitor
- Defined in:
- lib/intercom/service/visitor.rb
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
Methods included from ApiOperations::Delete
Methods included from ApiOperations::Save
#create, #identity_hash, #save
Methods included from ApiOperations::Find
Methods included from ApiOperations::Load
Methods inherited from BaseService
#collection_name, #collection_proxy_class, #from_api, #initialize
Constructor Details
This class inherits a constructor from Intercom::Service::BaseService
Instance Method Details
#collection_class ⇒ Object
15 16 17 |
# File 'lib/intercom/service/visitor.rb', line 15 def collection_class Intercom::Visitor end |
#convert(visitor, contact = false) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/intercom/service/visitor.rb', line 19 def convert(visitor, contact = false) req = { visitor: { user_id: visitor.user_id } } if contact req[:user] = identity_hash(contact) req[:type] = 'user' else req[:type] = 'lead' end Intercom::Contact.new.from_response( @client.post( "/visitors/convert", req ) ) end |