Sha256: ab6d7c04fbbb4182dad0651c7cafad1c624eee6b3d63858dd4a3a33146a22e95
Contents?: true
Size: 1.16 KB
Versions: 10
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true module CzechPostB2bClient module Services class TimePeriodStatisticator < CzechPostB2bClient::Services::Communicator attr_reader :from_date, :to_date def initialize(from_date:, to_date:) @from_date = from_date @to_date = to_date end private def request_builder_args { from_date: from_date, to_date: to_date } end def request_builder_class CzechPostB2bClient::RequestBuilders::GetStatsBuilder end def api_caller_class CzechPostB2bClient::Services::ApiCaller end def response_parser_class CzechPostB2bClient::ResponseParsers::GetStatsParser end def endpoint_path '/getStats' end 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 end end end
Version data entries
10 entries across 10 versions & 1 rubygems