Class: Headmin::Filter::BaseView

Inherits:
ViewModel show all
Defined in:
app/models/headmin/filter/base_view.rb

Instance Method Summary collapse

Methods inherited from ViewModel

#attributes, #initialize, #to_hash

Constructor Details

This class inherits a constructor from ViewModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ViewModel

Instance Method Details

#filter_button_optionsObject



22
23
24
25
26
# File 'app/models/headmin/filter/base_view.rb', line 22

def filter_button_options
  keys = %i[name label display_values filter]
  options = to_h.slice(*keys)
  default_filter_button_options.merge(options)
end

#filter_operator_optionsObject



16
17
18
19
20
# File 'app/models/headmin/filter/base_view.rb', line 16

def filter_operator_options
  keys = %i[allowed_operators]
  options = to_h.slice(*keys)
  default_filter_operator_options.merge(options)
end

#filter_template_optionsObject



10
11
12
13
14
# File 'app/models/headmin/filter/base_view.rb', line 10

def filter_template_options
  keys = %i[name label]
  options = to_h.slice(*keys)
  default_filter_template_options.merge(options)
end

#labelObject



28
29
30
# File 'app/models/headmin/filter/base_view.rb', line 28

def label
  @label || name.to_s.humanize
end


4
5
6
7
8
# File 'app/models/headmin/filter/base_view.rb', line 4

def menu_item_options
  keys = %i[name label]
  options = to_h.slice(*keys)
  default_menu_item_options.merge(options)
end