Class: BestBuy::Conditions::PreOwnedCondition
- Inherits:
-
Object
- Object
- BestBuy::Conditions::PreOwnedCondition
- Defined in:
- lib/best_buy/helpers/conditions/pre_owned_condition.rb
Instance Method Summary collapse
-
#initialize(condition_hash) ⇒ PreOwnedCondition
constructor
A new instance of PreOwnedCondition.
- #search_query ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(condition_hash) ⇒ PreOwnedCondition
Returns a new instance of PreOwnedCondition.
6 7 8 |
# File 'lib/best_buy/helpers/conditions/pre_owned_condition.rb', line 6 def initialize(condition_hash) @item_condition = condition_hash[:item_condition]&.downcase end |
Instance Method Details
#search_query ⇒ Object
14 15 16 |
# File 'lib/best_buy/helpers/conditions/pre_owned_condition.rb', line 14 def search_query '(condition=pre-owned|preowned=true)' end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/best_buy/helpers/conditions/pre_owned_condition.rb', line 10 def valid? @item_condition.present? && @item_condition == 'pre-owned' end |