Class: Spree::Filters::OptionsPresenter::FilterableOptionType

Inherits:
Struct
  • Object
show all
Defined in:
app/presenters/spree/filters/options_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#option_typeObject

Returns the value of attribute option_type

Returns:

  • (Object)

    the current value of option_type



4
5
6
# File 'app/presenters/spree/filters/options_presenter.rb', line 4

def option_type
  @option_type
end

#option_valuesObject

Returns the value of attribute option_values

Returns:

  • (Object)

    the current value of option_values



4
5
6
# File 'app/presenters/spree/filters/options_presenter.rb', line 4

def option_values
  @option_values
end

Instance Method Details

#to_hObject



7
8
9
10
11
12
13
14
# File 'app/presenters/spree/filters/options_presenter.rb', line 7

def to_h
  {
    id: option_type.id,
    name: option_type.name,
    presentation: option_type.presentation,
    option_values: option_values.map { |e| option_value_hash(e) }
  }
end