Class: MightyGrid::Filters::Base
- Inherits:
-
Object
- Object
- MightyGrid::Filters::Base
- Defined in:
- lib/mighty_grid/filters/base.rb
Direct Known Subclasses
BooleanFilter, CustomFilter, EnumFilter, SearchFilter, StringFilter, TextFilter
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#search_value ⇒ Object
Returns the value of attribute search_value.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mighty_grid/filters/base.rb', line 16 def initialize( = {}) = .clone .assert_valid_keys(self.class..keys) @options = .reverse_merge!(self.class.) @attribute = @options.delete(:attribute) || @options[:name] @model = @options.delete(:model) @default = @options.delete(:default) end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
4 5 6 |
# File 'lib/mighty_grid/filters/base.rb', line 4 def attribute @attribute end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
4 5 6 |
# File 'lib/mighty_grid/filters/base.rb', line 4 def default @default end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
4 5 6 |
# File 'lib/mighty_grid/filters/base.rb', line 4 def model @model end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/mighty_grid/filters/base.rb', line 4 def @options end |
#search_value ⇒ Object
Returns the value of attribute search_value.
5 6 7 |
# File 'lib/mighty_grid/filters/base.rb', line 5 def search_value @search_value end |