Class: Spree::Filters::OptionsPresenter
- Inherits:
-
Object
- Object
- Spree::Filters::OptionsPresenter
- Defined in:
- app/presenters/spree/filters/options_presenter.rb
Defined Under Namespace
Classes: FilterableOptionType
Instance Method Summary collapse
-
#initialize(option_values_scope:) ⇒ OptionsPresenter
constructor
A new instance of OptionsPresenter.
- #to_a ⇒ Object
Constructor Details
#initialize(option_values_scope:) ⇒ OptionsPresenter
Returns a new instance of OptionsPresenter.
28 29 30 |
# File 'app/presenters/spree/filters/options_presenter.rb', line 28 def initialize(option_values_scope:) @option_values = option_values_scope.includes(:option_type) end |
Instance Method Details
#to_a ⇒ Object
32 33 34 35 36 |
# File 'app/presenters/spree/filters/options_presenter.rb', line 32 def to_a .map do |option_type, option_values| FilterableOptionType.new(option_type: option_type, option_values: option_values) end end |