Class: Workarea::Pricing::Discount::BuySomeGetSome::OrderItemsByProduct::Product
- Inherits:
-
Struct
- Object
- Struct
- Workarea::Pricing::Discount::BuySomeGetSome::OrderItemsByProduct::Product
- Defined in:
- app/models/workarea/pricing/discount/buy_some_get_some/order_items_by_product.rb
Instance Attribute Summary collapse
-
#category_ids ⇒ Object
Returns the value of attribute category_ids.
-
#id ⇒ Object
Returns the value of attribute id.
-
#items ⇒ Object
Returns the value of attribute items.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
Instance Method Summary collapse
Instance Attribute Details
#category_ids ⇒ Object
Returns the value of attribute category_ids
7 8 9 |
# File 'app/models/workarea/pricing/discount/buy_some_get_some/order_items_by_product.rb', line 7 def category_ids @category_ids end |
#id ⇒ Object
Returns the value of attribute id
7 8 9 |
# File 'app/models/workarea/pricing/discount/buy_some_get_some/order_items_by_product.rb', line 7 def id @id end |
#items ⇒ Object
Returns the value of attribute items
7 8 9 |
# File 'app/models/workarea/pricing/discount/buy_some_get_some/order_items_by_product.rb', line 7 def items @items end |
#quantity ⇒ Object
Returns the value of attribute quantity
7 8 9 |
# File 'app/models/workarea/pricing/discount/buy_some_get_some/order_items_by_product.rb', line 7 def quantity @quantity end |
Instance Method Details
#matches_categories?(*ids) ⇒ Boolean
8 9 10 11 |
# File 'app/models/workarea/pricing/discount/buy_some_get_some/order_items_by_product.rb', line 8 def matches_categories?(*ids) match_ids = Array(ids).flatten.map(&:to_s) (category_ids.map(&:to_s) & match_ids).any? end |