Class: ActiveScaffold::DataStructures::FilterOption
- Inherits:
-
ActionLink
- Object
- ActionLink
- ActiveScaffold::DataStructures::FilterOption
- Defined in:
- lib/active_scaffold/data_structures/filter_option.rb
Constant Summary
Constants inherited from ActionLink
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
- #description ⇒ Object
-
#filter_name ⇒ Object
readonly
Returns the value of attribute filter_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from ActionLink
#action, #column, #confirm, #controller, #controller_actions, #crud_type, #dynamic_parameters, #html_options, #ignore_method, #image, #keep_open, #label, #method, #parameters, #position, #prompt, #prompt_required, #refresh_on_close, #security_method, #toggle, #type, #weight
Instance Method Summary collapse
-
#initialize(filter_name, name, options = {}) ⇒ FilterOption
constructor
A new instance of FilterOption.
Methods inherited from ActionLink
#confirm?, #freeze, #initialize_copy, #inline=, #inline?, #keep_open?, #name_to_cache, #nested_link?, #page=, #page?, #popup=, #popup?, #prompt?, #prompt_required?, #security_method_set?, #static_controller?
Constructor Details
#initialize(filter_name, name, options = {}) ⇒ FilterOption
Returns a new instance of FilterOption.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/active_scaffold/data_structures/filter_option.rb', line 7 def initialize(filter_name, name, = {}) @filter_name = filter_name @label = @name = name.to_sym super( :index, .merge( action: :index, type: :collection, method: :get, position: false, toggle: true ) ) parameters.merge!(filter_name => name) end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
5 6 7 |
# File 'lib/active_scaffold/data_structures/filter_option.rb', line 5 def conditions @conditions end |
#description ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/active_scaffold/data_structures/filter_option.rb', line 23 def description case @description when Symbol ActiveScaffold::Registry.cache(:translations, @description) { as_(@description) } else @description end end |
#filter_name ⇒ Object (readonly)
Returns the value of attribute filter_name.
3 4 5 |
# File 'lib/active_scaffold/data_structures/filter_option.rb', line 3 def filter_name @filter_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/active_scaffold/data_structures/filter_option.rb', line 3 def name @name end |