active_shipping 1.8.2 → 1.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/active_shipping/rate_estimate.rb +6 -1
- data/lib/active_shipping/version.rb +1 -1
- data/test/unit/rate_estimate_test.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 572372570feb79b6fd7481886401fa9b2fb89adb
|
4
|
+
data.tar.gz: f7b5f0dc4eda2870f548a9c9bf533cc8221e4e26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bacd3051567a465b2d3a1b8f1f1c430cc9b300ea5b0877bc0947d5ed43e83b9170fd772a21d417ee74de6329eeaf6b088ecfeb7c0957d3bf855eaa85506093f7
|
7
|
+
data.tar.gz: 546dd1e2a5855b9f86744da0dc14b3afa86aa67705af72156e3412d43844f0f8f204403e43e618ce30b4e8fdc1716eabd163713be44b8842e10f6f57fc7ac036
|
data/CHANGELOG.md
CHANGED
@@ -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]
|
@@ -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.
|
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-
|
14
|
+
date: 2016-08-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: quantified
|