market_town-checkout 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 248333e5411064b778918baad5c255f009ebd07f
|
4
|
+
data.tar.gz: 708d710d4e7ec962a017c72cc9099cd3922461f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6dcd7003da193d40b838a74ccbb170d40157a89c820736797f37520c39be678135619a9ebed271063723766060c3689d0680e361fad7b933f63ed03aad03ca
|
7
|
+
data.tar.gz: 14665062ba3b4d705110fe6b44823645ad97030856d0343fffb36c6b105aaef83b157f2d6ade5ff6d71c161d3c45fd5100a72fdd503613df53e92ab6adc10651
|
data/lib/market_town/checkout.rb
CHANGED
@@ -30,6 +30,12 @@ module MarketTown
|
|
30
30
|
#
|
31
31
|
# To find out more about `AppContainer` please see {Dependencies}.
|
32
32
|
#
|
33
|
+
# ## Available steps
|
34
|
+
#
|
35
|
+
# - {AddressStep} – Handles the taking of billing and delivery addresses
|
36
|
+
# - {DeliveryStep} – Handles the choosing of delivery method
|
37
|
+
# - {CompleteStep} – Handles completion of order
|
38
|
+
#
|
33
39
|
module Checkout
|
34
40
|
extend self
|
35
41
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module MarketTown
|
2
2
|
module Checkout
|
3
3
|
class CartStep < Step
|
4
|
+
class NoLineItemsError < Error; end
|
5
|
+
|
4
6
|
steps :ensure_line_items,
|
5
7
|
:load_default_addresses,
|
6
8
|
:finish_cart_step
|
@@ -8,6 +10,9 @@ module MarketTown
|
|
8
10
|
protected
|
9
11
|
|
10
12
|
def ensure_line_items(state)
|
13
|
+
unless deps.order.has_line_items?(state)
|
14
|
+
raise NoLineItemsError.new(state)
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
def load_default_addresses(state)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: market_town-checkout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Morton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|