ecwid_api 0.2.1 → 0.2.2
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 +4 -4
- data/lib/ecwid_api/order.rb +19 -13
- data/lib/ecwid_api/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46dcd4e6a2d43c7fad4d64e00476a240b0d18c02
|
4
|
+
data.tar.gz: ea1cccacb59b117efa147353ad038605a867a957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8c88afb4c895ef03be8d767e2d8a347ca4109852813df33fc77126ada5109bc67c5809faaf48f77e2a8152eaea4be1e09e1a2478cf33204c3ac80ab73da6e13
|
7
|
+
data.tar.gz: e7a441c8d51c30971954ad531930c7777a5af0abde8d77cfd850ab41c4e382397cdbc3f2d932f9ba7d11aeadf4b1cbefccc123ca6ed3fb60fd8e79d3d0e7b648
|
data/lib/ecwid_api/order.rb
CHANGED
@@ -42,24 +42,20 @@ module EcwidApi
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# Public: Returns the billing person
|
45
|
+
#
|
46
|
+
# If there isn't a billing_person, then it assumed to be the shipping_person
|
47
|
+
#
|
45
48
|
def billing_person
|
46
|
-
|
47
|
-
|
48
|
-
@billing_person ||= if data["billingPerson"]
|
49
|
-
Person.new(data["billingPerson"])
|
50
|
-
else
|
51
|
-
shipping_person
|
52
|
-
end
|
49
|
+
build_billing_person || build_shipping_person
|
53
50
|
end
|
54
51
|
|
55
52
|
# Public: Returns the shipping person
|
53
|
+
#
|
54
|
+
# If there isn't a shipping_person, then it is assumed to be the
|
55
|
+
# billing_person
|
56
|
+
#
|
56
57
|
def shipping_person
|
57
|
-
|
58
|
-
@shipping_person ||= if data["shippingPerson"]
|
59
|
-
Person.new(data["shippingPerson"])
|
60
|
-
else
|
61
|
-
billing_person
|
62
|
-
end
|
58
|
+
build_shipping_person || build_billing_person
|
63
59
|
end
|
64
60
|
|
65
61
|
# Public: Returns a Array of `OrderItem` objects
|
@@ -78,5 +74,15 @@ module EcwidApi
|
|
78
74
|
def fulfillment_status
|
79
75
|
super && super.downcase.to_sym
|
80
76
|
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def build_billing_person
|
81
|
+
@billing_person ||= data["billingPerson"] && Person.new(data["billingPerson"])
|
82
|
+
end
|
83
|
+
|
84
|
+
def build_shipping_person
|
85
|
+
@shipping_person ||= data["shippingPerson"] && Person.new(data["shippingPerson"])
|
86
|
+
end
|
81
87
|
end
|
82
88
|
end
|
data/lib/ecwid_api/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED