Class: ActiveMerchant::Shipping::Shipment
- Includes:
- ActiveMerchant::Shipping
- Defined in:
- lib/active_shipping/shipping/shipment.rb
Direct Known Subclasses
Constant Summary collapse
- FEDEX_PAYMENT_TYPES =
[ 'COLLECT', 'RECIPIENT', 'SENDER', 'THIRD_PARTY' ]
- FEDEX_DROPOFF_TYPES =
[ "REGULAR_PICKUP", "REQUEST_COURIER", "DROP_BOX", "BUSINESS_SERVICE_CENTER", "STATION" ]
- FEDEX_RATE_REQUEST_TYPES =
[ "ACCOUNT", "LIST" ]
Instance Attribute Summary collapse
-
#dropoff_type ⇒ Object
Returns the value of attribute dropoff_type.
-
#label ⇒ Object
Returns the value of attribute label.
-
#package_count ⇒ Object
Returns the value of attribute package_count.
-
#packaging_type ⇒ Object
Returns the value of attribute packaging_type.
-
#payment_type ⇒ Object
Returns the value of attribute payment_type.
-
#payor_account_country ⇒ Object
readonly
Returns the value of attribute payor_account_country.
-
#payor_account_number ⇒ Object
Returns the value of attribute payor_account_number.
-
#rate_request_type ⇒ Object
Returns the value of attribute rate_request_type.
-
#recipient ⇒ Object
Returns the value of attribute recipient.
-
#requested_packages ⇒ Object
Returns the value of attribute requested_packages.
-
#service ⇒ Object
Returns the value of attribute service.
-
#ship_at ⇒ Object
Returns the value of attribute ship_at.
-
#shipper ⇒ Object
Returns the value of attribute shipper.
-
#special_services ⇒ Object
Returns the value of attribute special_services.
-
#total_insured_amount ⇒ Object
Returns the value of attribute total_insured_amount.
-
#total_insured_currency ⇒ Object
Returns the value of attribute total_insured_currency.
-
#total_weight_units ⇒ Object
Returns the value of attribute total_weight_units.
-
#total_weight_value ⇒ Object
Returns the value of attribute total_weight_value.
-
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
-
#transit_time ⇒ Object
Returns the value of attribute transit_time.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Shipment
constructor
A new instance of Shipment.
Methods included from ActiveMerchant::Shipping
Constructor Details
#initialize(attrs = {}) ⇒ Shipment
Returns a new instance of Shipment.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/active_shipping/shipping/shipment.rb', line 49 def initialize(attrs = {}) attrs.each do |key, value| self.send("#{key}=", value) if self.respond_to?("#{key}=") end self.label ||= Label.new(:format_type => 'COMMON2D') self.requested_packages ||= 1 self.dropoff_type ||= 'REGULAR_PICKUP' self.service ||= 'FEDEX_GROUND' self.packaging_type ||= 'YOUR_PACKAGING' self.ship_at ||= Time.now self.package_count ||= 1 self.rate_request_type ||= 'ACCOUNT' self.total_insured_currency ||= 'USD' if self.total_insured_amount self.total_weight_units ||= 'LB' if self.total_weight_value end |
Instance Attribute Details
#dropoff_type ⇒ Object
Returns the value of attribute dropoff_type.
37 38 39 |
# File 'lib/active_shipping/shipping/shipment.rb', line 37 def dropoff_type @dropoff_type end |
#label ⇒ Object
Returns the value of attribute label.
35 36 37 |
# File 'lib/active_shipping/shipping/shipment.rb', line 35 def label @label end |
#package_count ⇒ Object
Returns the value of attribute package_count.
39 40 41 |
# File 'lib/active_shipping/shipping/shipment.rb', line 39 def package_count @package_count end |
#packaging_type ⇒ Object
Returns the value of attribute packaging_type.
28 29 30 |
# File 'lib/active_shipping/shipping/shipment.rb', line 28 def packaging_type @packaging_type end |
#payment_type ⇒ Object
Returns the value of attribute payment_type.
33 34 35 |
# File 'lib/active_shipping/shipping/shipment.rb', line 33 def payment_type @payment_type end |
#payor_account_country ⇒ Object (readonly)
Returns the value of attribute payor_account_country.
47 48 49 |
# File 'lib/active_shipping/shipping/shipment.rb', line 47 def payor_account_country @payor_account_country end |
#payor_account_number ⇒ Object
Returns the value of attribute payor_account_number.
42 43 44 |
# File 'lib/active_shipping/shipping/shipment.rb', line 42 def payor_account_number @payor_account_number end |
#rate_request_type ⇒ Object
Returns the value of attribute rate_request_type.
38 39 40 |
# File 'lib/active_shipping/shipping/shipment.rb', line 38 def rate_request_type @rate_request_type end |
#recipient ⇒ Object
Returns the value of attribute recipient.
32 33 34 |
# File 'lib/active_shipping/shipping/shipment.rb', line 32 def recipient @recipient end |
#requested_packages ⇒ Object
Returns the value of attribute requested_packages.
36 37 38 |
# File 'lib/active_shipping/shipping/shipment.rb', line 36 def requested_packages @requested_packages end |
#service ⇒ Object
Returns the value of attribute service.
27 28 29 |
# File 'lib/active_shipping/shipping/shipment.rb', line 27 def service @service end |
#ship_at ⇒ Object
Returns the value of attribute ship_at.
26 27 28 |
# File 'lib/active_shipping/shipping/shipment.rb', line 26 def ship_at @ship_at end |
#shipper ⇒ Object
Returns the value of attribute shipper.
29 30 31 |
# File 'lib/active_shipping/shipping/shipment.rb', line 29 def shipper @shipper end |
#special_services ⇒ Object
Returns the value of attribute special_services.
34 35 36 |
# File 'lib/active_shipping/shipping/shipment.rb', line 34 def special_services @special_services end |
#total_insured_amount ⇒ Object
Returns the value of attribute total_insured_amount.
30 31 32 |
# File 'lib/active_shipping/shipping/shipment.rb', line 30 def total_insured_amount @total_insured_amount end |
#total_insured_currency ⇒ Object
Returns the value of attribute total_insured_currency.
31 32 33 |
# File 'lib/active_shipping/shipping/shipment.rb', line 31 def total_insured_currency @total_insured_currency end |
#total_weight_units ⇒ Object
Returns the value of attribute total_weight_units.
41 42 43 |
# File 'lib/active_shipping/shipping/shipment.rb', line 41 def total_weight_units @total_weight_units end |
#total_weight_value ⇒ Object
Returns the value of attribute total_weight_value.
40 41 42 |
# File 'lib/active_shipping/shipping/shipment.rb', line 40 def total_weight_value @total_weight_value end |
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
44 45 46 |
# File 'lib/active_shipping/shipping/shipment.rb', line 44 def tracking_number @tracking_number end |
#transit_time ⇒ Object
Returns the value of attribute transit_time.
45 46 47 |
# File 'lib/active_shipping/shipping/shipment.rb', line 45 def transit_time @transit_time end |