Class: Minfraud::Components::ShoppingCartItem
- Defined in:
- lib/minfraud/components/shopping_cart_item.rb
Instance Attribute Summary collapse
-
#category ⇒ String
The category of the item.
-
#item_id ⇒ String
The internal ID of the item.
-
#price ⇒ Float
The per-unit price of this item in the shopping cart.
-
#quantity ⇒ Integer
The quantity of the item in the shopping cart.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Minfraud::Components::ShoppingCartItem
constructor
Creates Minfraud::Components::ShoppingCartItem instance.
Methods inherited from Base
Constructor Details
#initialize(params = {}) ⇒ Minfraud::Components::ShoppingCartItem
Creates Minfraud::Components::ShoppingCartItem instance
23 24 25 26 27 28 |
# File 'lib/minfraud/components/shopping_cart_item.rb', line 23 def initialize(params = {}) @category = params[:category] @item_id = params[:item_id] @quantity = params[:quantity] @price = params[:price] end |
Instance Attribute Details
#category ⇒ String
Returns The category of the item.
6 7 8 |
# File 'lib/minfraud/components/shopping_cart_item.rb', line 6 def category @category end |
#item_id ⇒ String
Returns The internal ID of the item.
10 11 12 |
# File 'lib/minfraud/components/shopping_cart_item.rb', line 10 def item_id @item_id end |
#price ⇒ Float
Returns The per-unit price of this item in the shopping cart. This should use the same currency as the order currency.
18 19 20 |
# File 'lib/minfraud/components/shopping_cart_item.rb', line 18 def price @price end |
#quantity ⇒ Integer
Returns The quantity of the item in the shopping cart.
14 15 16 |
# File 'lib/minfraud/components/shopping_cart_item.rb', line 14 def quantity @quantity end |