active_shipping 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1135f7f33aa9294d388558606f3c8254922754b3
4
- data.tar.gz: 9af9fd3e964b4039447ca04746d85f30e8ea8675
3
+ metadata.gz: 572372570feb79b6fd7481886401fa9b2fb89adb
4
+ data.tar.gz: f7b5f0dc4eda2870f548a9c9bf533cc8221e4e26
5
5
  SHA512:
6
- metadata.gz: ecec436c0d80f5d2a11e0baa4274adb28d91412d23643d0c44772665a9875c258070de1d2b68fc5584e06b24d6ca1bdfa5c0512863f74a8b4383f97427d96b07
7
- data.tar.gz: 7d963a5f838344b627cf26758de42e5363dad9d2873a698c43d96942acc1bc650f45b11bf8ee8c46056ac845470c9bba4c360962de927cc2b27902f12e889b2c
6
+ metadata.gz: bacd3051567a465b2d3a1b8f1f1c430cc9b300ea5b0877bc0947d5ed43e83b9170fd772a21d417ee74de6329eeaf6b088ecfeb7c0957d3bf855eaa85506093f7
7
+ data.tar.gz: 546dd1e2a5855b9f86744da0dc14b3afa86aa67705af72156e3412d43844f0f8f204403e43e618ce30b4e8fdc1716eabd163713be44b8842e10f6f57fc7ac036
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # ActiveShipping CHANGELOG
2
2
 
3
+ ### v1.8.3
4
+ - Add description field to rate estimates
5
+
3
6
  ### v1.8.2
4
7
  - Add option for FedEx label format
5
8
  - Fix kunaki remote tests broken due to more shipping options
@@ -27,6 +27,10 @@ module ActiveShipping
27
27
  # The code of the shipping service
28
28
  # @return [String]
29
29
  #
30
+ # @!attribute description
31
+ # Public description of the shipping service (e.g. "2 days delivery")
32
+ # @return [String]
33
+ #
30
34
  # @!attribute shipping_date
31
35
  # The date on which the shipment will be expected. Normally, this means that the
32
36
  # delivery date range can only pe prmoised if the shipment is handed over on or
@@ -73,7 +77,7 @@ module ActiveShipping
73
77
  #
74
78
  class RateEstimate
75
79
  attr_accessor :origin, :destination, :package_rates,
76
- :carrier, :service_name, :service_code,
80
+ :carrier, :service_name, :service_code, :description,
77
81
  :shipping_date, :delivery_date, :delivery_range,
78
82
  :currency, :negotiated_rate, :insurance_price,
79
83
  :estimate_reference, :expires_at, :pickup_time,
@@ -83,6 +87,7 @@ module ActiveShipping
83
87
  def initialize(origin, destination, carrier, service_name, options = {})
84
88
  self.origin, self.destination, self.carrier, self.service_name = origin, destination, carrier, service_name
85
89
  self.service_code = options[:service_code]
90
+ self.description = options[:description]
86
91
  self.estimate_reference = options[:estimate_reference]
87
92
  self.pickup_time = options[:pickup_time]
88
93
  self.expires_at = options[:expires_at]
@@ -1,3 +1,3 @@
1
1
  module ActiveShipping
2
- VERSION = "1.8.2"
2
+ VERSION = "1.8.3"
3
3
  end
@@ -26,6 +26,11 @@ class RateEstimateTest < Minitest::Test
26
26
  assert_equal false, est.phone_required
27
27
  end
28
28
 
29
+ def test_accepts_description_field
30
+ rate_estimate = RateEstimate.new(@origin, @destination, @carrier, @service_name, @options.merge(description: "It's free!"))
31
+ assert_equal "It's free!", rate_estimate.description
32
+ end
33
+
29
34
  def test_date_for_invalid_string_in_ruby_19
30
35
  assert_nil @rate_estimate.send(:date_for, "Up to 2 weeks") if RUBY_VERSION.include?('1.9')
31
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_shipping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James MacAulay
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-08-04 00:00:00.000000000 Z
14
+ date: 2016-08-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: quantified