Class: BBMB::Html::State::Result

Inherits:
Global
  • Object
show all
Defined in:
lib/bbmb/html/state/result.rb

Direct Known Subclasses

FavoritesResult

Defined Under Namespace

Classes: Result

Constant Summary collapse

VIEW =
View::Result

Instance Method Summary collapse

Methods inherited from Global

#direct_arguments, #direct_request?, #initialize, #logout, mandatory, #requested_event, #trigger, #user_input

Constructor Details

This class inherits a constructor from BBMB::Html::State::Global

Instance Method Details

#_orderObject



58
59
60
# File 'lib/bbmb/html/state/result.rb', line 58

def _order
  _customer.current_order
end

#direct_argument_keysObject



52
53
54
# File 'lib/bbmb/html/state/result.rb', line 52

def direct_argument_keys
  [:query]
end

#direct_eventObject



55
56
57
# File 'lib/bbmb/html/state/result.rb', line 55

def direct_event
  [:search, {:query => @query}]
end

#initObject



44
45
46
47
48
49
50
51
# File 'lib/bbmb/html/state/result.rb', line 44

def init
  @query = @session.persistent_user_input(:query)
  products = Model::Product.search_by_description(@query)
  unless(@session.lookandfeel.enabled? :free_products, false)
    products = products.select { |product| product.price }
  end
  @model = Result.new _order, products
end