class CzechPostB2bClient::Services::TimePeriodStatisticator

Attributes

from_date[R]
to_date[R]

Public Class Methods

new(from_date:, to_date:) click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 8
def initialize(from_date:, to_date:)
  @from_date = from_date
  @to_date = to_date
end

Private Instance Methods

api_caller_class() click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 23
def api_caller_class
  CzechPostB2bClient::Services::ApiCaller
end
build_result_from(response_hash) click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 35
def build_result_from(response_hash)
  imports = response_hash[:imports]
  OpenStruct.new(requests: OpenStruct.new(total: imports[:requested],
                                          with_errors: imports[:with_errors],
                                          successful: imports[:successful]),
                 imported_parcels: imports[:imported_parcels])
end
endpoint_path() click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 31
def endpoint_path
  '/getStats'
end
request_builder_args() click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 15
def request_builder_args
  { from_date: from_date, to_date: to_date }
end
request_builder_class() click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 19
def request_builder_class
  CzechPostB2bClient::RequestBuilders::GetStatsBuilder
end
response_parser_class() click to toggle source
# File lib/czech_post_b2b_client/services/time_period_statisticator.rb, line 27
def response_parser_class
  CzechPostB2bClient::ResponseParsers::GetStatsParser
end