Class: Alchemy::Admin::Resource::SelectFilter

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/admin/resource/select_filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, resource_name:, label:, include_blank:, options:, params:) ⇒ SelectFilter

Returns a new instance of SelectFilter.



22
23
24
25
26
27
28
29
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 22

def initialize(name:, resource_name:, label:, include_blank:, options:, params:)
  @name = name
  @options = options
  @label = label
  @include_blank = include_blank
  @resource_name = resource_name
  @selected = get_selected_value_from(params)
end

Instance Attribute Details

#include_blankObject (readonly)

Returns the value of attribute include_blank.



7
8
9
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 7

def include_blank
  @include_blank
end

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 7

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 7

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 7

def options
  @options
end

#resource_nameObject (readonly)

Returns the value of attribute resource_name.



7
8
9
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 7

def resource_name
  @resource_name
end

#selectedObject (readonly)

Returns the value of attribute selected.



7
8
9
# File 'app/components/alchemy/admin/resource/select_filter.rb', line 7

def selected
  @selected
end