Class: BalihooLpcClient::Request::Metrics

Inherits:
ApiBase
  • Object
show all
Defined in:
lib/balihoo_lpc_client/request/metrics.rb

Instance Attribute Summary collapse

Attributes inherited from ApiBase

#params

Attributes inherited from Base

#api

Instance Method Summary collapse

Constructor Details

#initialize(api:, params:, tactic_id:) ⇒ Metrics

Returns a new instance of Metrics.



6
7
8
9
# File 'lib/balihoo_lpc_client/request/metrics.rb', line 6

def initialize(api:, params:, tactic_id:)
  super(api: api, params: params)
  self.tactic_id = tactic_id
end

Instance Attribute Details

#tactic_idObject

Returns the value of attribute tactic_id.



4
5
6
# File 'lib/balihoo_lpc_client/request/metrics.rb', line 4

def tactic_id
  @tactic_id
end

Instance Method Details

#fetchObject



11
12
13
14
15
# File 'lib/balihoo_lpc_client/request/metrics.rb', line 11

def fetch
  response = self.class.get("/tactic/#{tactic_id}/metrics", opts).parsed_response
  handle_errors_with(klass: ApiResponseError, response: response)
  handle_response(response: response, klass: klass_for(response: response), mappable: false)
end