e4commerce 0.3.0 → 0.3.1
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/Gemfile.lock +1 -1
- data/lib/e4commerce.rb +0 -5
- data/lib/e4commerce/payment.rb +17 -13
- data/lib/e4commerce/product.rb +17 -14
- data/lib/e4commerce/version.rb +1 -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: e18a88737c150b4c87a2fa4da66c8a25a5cab804
|
4
|
+
data.tar.gz: ecf67733aedaa904b2130f0c7f13b8f066b90257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c084ebe2efe13d6121c4b4f55eb2a1140dce79fbfa1c0da84848d174ce4f550204cafdfa07bad8145028073b545e4f1ad23a8c1316d85abaa527b04f9878b561
|
7
|
+
data.tar.gz: d92b197892b9759745e5cf727df1cf2eff920405d160da56fc33199ba215fd6e8294240e6108b5e04d6de6fe5047d0075a8f569663d801cdd2aa533e91d3687d
|
data/Gemfile.lock
CHANGED
data/lib/e4commerce.rb
CHANGED
data/lib/e4commerce/payment.rb
CHANGED
@@ -1,23 +1,27 @@
|
|
1
|
+
module E4commerce
|
2
|
+
|
1
3
|
require "abstraction"
|
2
4
|
require "active_record"
|
3
5
|
|
4
|
-
#class E4CPayment < ActiveRecord::Base ~> Rails project, need database
|
5
|
-
class E4CPayment
|
6
|
-
|
6
|
+
#class E4CPayment < ActiveRecord::Base ~> Rails project, need database
|
7
|
+
class E4CPayment
|
8
|
+
abstract
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
+
attr_accessor :product_list
|
11
|
+
attr_accessor :total
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
def calculate_total(products)
|
14
|
+
raise NotImplementedError, "Child must implement method"
|
15
|
+
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
def create_payment
|
18
|
+
raise NotImplementedError, "Child must implement method"
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_product(product)
|
22
|
+
raise NotImplementedError, "Child must implement method"
|
23
|
+
end
|
18
24
|
|
19
|
-
def add_product(product)
|
20
|
-
raise NotImplementedError, "Child must implement method"
|
21
25
|
end
|
22
26
|
|
23
27
|
end
|
data/lib/e4commerce/product.rb
CHANGED
@@ -1,20 +1,23 @@
|
|
1
|
-
|
2
|
-
require "active_record"
|
1
|
+
module E4commerce
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
abstract
|
3
|
+
require "abstraction"
|
4
|
+
require "active_record"
|
7
5
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
attr_accessor :unit_price
|
6
|
+
# class E4CProduct < ActiveRecord::Base -> Rails project, need database
|
7
|
+
class E4CProduct
|
8
|
+
abstract
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
attr_accessor :title
|
11
|
+
attr_accessor :serial_number
|
12
|
+
attr_accessor :brand
|
13
|
+
attr_accessor :unit_price
|
14
|
+
|
15
|
+
def initialize(title, serial_number, brand, unit_price)
|
16
|
+
@title = title
|
17
|
+
@serial_number = serial_number
|
18
|
+
@brand = brand
|
19
|
+
@unit_price = unit_price
|
20
|
+
end
|
18
21
|
end
|
19
22
|
|
20
23
|
end
|
data/lib/e4commerce/version.rb
CHANGED