Class: MightyGrid::Filters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/mighty_grid/filters/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  options = options.clone

  options.assert_valid_keys(self.class.default_options.keys)

  @options = options.reverse_merge!(self.class.default_options)
  @attribute = @options.delete(:attribute) || @options[:name]
  @model = @options.delete(:model)
  @default = @options.delete(:default)
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



4
5
6
# File 'lib/mighty_grid/filters/base.rb', line 4

def attribute
  @attribute
end

#defaultObject (readonly)

Returns the value of attribute default.



4
5
6
# File 'lib/mighty_grid/filters/base.rb', line 4

def default
  @default
end

#modelObject (readonly)

Returns the value of attribute model.



4
5
6
# File 'lib/mighty_grid/filters/base.rb', line 4

def model
  @model
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/mighty_grid/filters/base.rb', line 4

def options
  @options
end

#search_valueObject

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