Class: E4commerce::BankBillet
- Inherits:
-
E4CPayment
- Object
- ActiveRecord::Base
- E4CPayment
- E4commerce::BankBillet
- Defined in:
- lib/e4commerce/bank_billet.rb
Instance Attribute Summary
Attributes inherited from E4CPayment
Instance Method Summary collapse
- #add_product(product) ⇒ Object
- #calculate_total(product_list) ⇒ Object
- #create_payment(client) ⇒ Object
Instance Method Details
#add_product(product) ⇒ Object
25 26 27 28 |
# File 'lib/e4commerce/bank_billet.rb', line 25 def add_product(product) # Adds a product or an array of products to the products list self.product_list << product end |
#calculate_total(product_list) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/e4commerce/bank_billet.rb', line 10 def calculate_total(product_list) # Determine total price sum of products in list self.product_list.each do |product| self.total += product.unit_price end return self.total end |
#create_payment(client) ⇒ Object
20 21 22 23 |
# File 'lib/e4commerce/bank_billet.rb', line 20 def create_payment(client) raise NotImplementedError, "Child must implement method" end |