class BestBuy::Conditions::MaxPriceCondition
Public Class Methods
new(condition_hash)
click to toggle source
# File lib/best_buy/helpers/conditions/max_price_condition.rb, line 6 def initialize(condition_hash) @max_price = condition_hash[:max_price] end
Public Instance Methods
search_query()
click to toggle source
# File lib/best_buy/helpers/conditions/max_price_condition.rb, line 14 def search_query "((regularPrice<=#{@max_price}&onSale=false)|(salePrice<=#{@max_price}&onSale=true))" end
valid?()
click to toggle source
# File lib/best_buy/helpers/conditions/max_price_condition.rb, line 10 def valid? @max_price.present? end