Class: ActiveShipping::AustraliaPost::CombinedResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/active_shipping/carriers/australia_post.rb

Instance Method Summary collapse

Constructor Details

#initialize(origin, destination, packages, requests) ⇒ CombinedResponse

Returns a new instance of CombinedResponse.



74
75
76
77
78
79
# File 'lib/active_shipping/carriers/australia_post.rb', line 74

def initialize(origin, destination, packages, requests)
  @requests    = requests
  @origin      = origin
  @destination = destination
  @packages    = packages
end

Instance Method Details

#optionsObject



81
82
83
84
85
86
87
# File 'lib/active_shipping/carriers/australia_post.rb', line 81

def options
  {
    rates:         rates,
    raw_responses: @requests.map(&:raw_response),
    request:       @requests.map(&:url)
  }
end

#paramsObject



89
90
91
92
93
# File 'lib/active_shipping/carriers/australia_post.rb', line 89

def params
  {
    responses: @requests.map(&:response)
  }
end