Class: Intercom::Service::BaseService

Inherits:
Object
  • Object
show all
Defined in:
lib/intercom/service/base_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ BaseService

Returns a new instance of BaseService.


8
9
10
# File 'lib/intercom/service/base_service.rb', line 8

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client


6
7
8
# File 'lib/intercom/service/base_service.rb', line 6

def client
  @client
end

Instance Method Details

#collection_classObject

Raises:

  • (NotImplementedError)

12
13
14
# File 'lib/intercom/service/base_service.rb', line 12

def collection_class
  raise NotImplementedError
end

#collection_proxy_classObject


16
17
18
# File 'lib/intercom/service/base_service.rb', line 16

def collection_proxy_class
  Intercom::ClientCollectionProxy
end

#from_api(api_response) ⇒ Object


20
21
22
23
24
# File 'lib/intercom/service/base_service.rb', line 20

def from_api(api_response)
  object = collection_class.new
  object.from_response(api_response)
  object
end