class BestBuy::Conditions::NewCondition

Public Class Methods

new(condition_hash) click to toggle source
# File lib/best_buy/helpers/conditions/new_condition.rb, line 6
def initialize(condition_hash)
  @item_condition = condition_hash[:item_condition]&.downcase
end

Public Instance Methods

search_query() click to toggle source
# File lib/best_buy/helpers/conditions/new_condition.rb, line 14
def search_query
  '(condition=new|new=true)'
end
valid?() click to toggle source
# File lib/best_buy/helpers/conditions/new_condition.rb, line 10
def valid?
  @item_condition.present? && @item_condition == 'new'
end