Class: Shippinglogic::UPS::ShipConfirm::Details

Inherits:
Object
  • Object
show all
Defined in:
lib/shippinglogic/ups/ship_confirm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Details

Returns a new instance of Details.



11
12
13
14
15
16
17
18
# File 'lib/shippinglogic/ups/ship_confirm.rb', line 11

def initialize(response)
  self.digest           = response[:shipment_digest]
  self.tracking_number  = response[:shipment_identification_number]
  
  charges       = response[:shipment_charges][:total_charges]
  self.rate     = BigDecimal.new(charges[:monetary_value])
  self.currency = charges[:currency_code]
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



9
10
11
# File 'lib/shippinglogic/ups/ship_confirm.rb', line 9

def currency
  @currency
end

#digestObject

Returns the value of attribute digest.



9
10
11
# File 'lib/shippinglogic/ups/ship_confirm.rb', line 9

def digest
  @digest
end

#rateObject

Returns the value of attribute rate.



9
10
11
# File 'lib/shippinglogic/ups/ship_confirm.rb', line 9

def rate
  @rate
end

#tracking_numberObject

Returns the value of attribute tracking_number.



9
10
11
# File 'lib/shippinglogic/ups/ship_confirm.rb', line 9

def tracking_number
  @tracking_number
end