Class: Naver::Searchad::Api::Core::BaseService

Inherits:
Object
  • Object
show all
Includes:
Helpers, Logging
Defined in:
lib/naver/searchad/api/core/base_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#logger

Constructor Details

#initialize(url, base_path = '') ⇒ BaseService

Returns a new instance of BaseService.



25
26
27
28
29
30
# File 'lib/naver/searchad/api/core/base_service.rb', line 25

def initialize(url, base_path = '')
  @url = url
  @base_path = base_path
  @request_options = RequestOptions.default.dup
  @client_options = ClientOptions.default.dup
end

Instance Attribute Details

#base_pathObject (readonly)

Returns the value of attribute base_path.



23
24
25
# File 'lib/naver/searchad/api/core/base_service.rb', line 23

def base_path
  @base_path
end

#client_optionsObject

Returns the value of attribute client_options.



21
22
23
# File 'lib/naver/searchad/api/core/base_service.rb', line 21

def client_options
  @client_options
end

#request_optionsObject

Returns the value of attribute request_options.



20
21
22
# File 'lib/naver/searchad/api/core/base_service.rb', line 20

def request_options
  @request_options
end

#urlObject (readonly)

Returns the value of attribute url.



22
23
24
# File 'lib/naver/searchad/api/core/base_service.rb', line 22

def url
  @url
end

Instance Method Details

#authorizationObject



36
37
38
# File 'lib/naver/searchad/api/core/base_service.rb', line 36

def authorization
  request_options.authorization
end

#authorization=(authorization) ⇒ Object



32
33
34
# File 'lib/naver/searchad/api/core/base_service.rb', line 32

def authorization=(authorization)
  @request_options.authorization = authorization
end

#clientObject



40
41
42
# File 'lib/naver/searchad/api/core/base_service.rb', line 40

def client
  @client ||= new_client
end