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

Inherits:
Object
  • Object
show all
Includes:
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.



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

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.



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

def base_path
  @base_path
end

#client_optionsObject (readonly)

Returns the value of attribute client_options.



18
19
20
# File 'lib/naver/searchad/api/core/base_service.rb', line 18

def client_options
  @client_options
end

#request_optionsObject (readonly)

Returns the value of attribute request_options.



17
18
19
# File 'lib/naver/searchad/api/core/base_service.rb', line 17

def request_options
  @request_options
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#authorizationObject



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

def authorization
  request_options.authorization
end

#authorization=(authorization) ⇒ Object



29
30
31
# File 'lib/naver/searchad/api/core/base_service.rb', line 29

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

#clientObject



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

def client
  @client ||= new_client
end