Class: FortyFacets::FilterDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/forty_facets/filter_definition.rb

Overview

Base class for the classes storing the definition of differently behaving filters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search, path, options) ⇒ FilterDefinition

Returns a new instance of FilterDefinition.



8
9
10
11
12
13
14
# File 'lib/forty_facets/filter_definition.rb', line 8

def initialize search, path, options
  @search = search
  @path = [path].flatten
  @options = options

  init_associations
end

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def association
  @association
end

#attributeObject (readonly)

Returns the value of attribute attribute.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def attribute
  @attribute
end

#column_nameObject (readonly)

Returns the value of attribute column_name.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def column_name
  @column_name
end

#joinsObject (readonly)

Returns the value of attribute joins.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def joins
  @joins
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def options
  @options
end

#origin_classObject (readonly)

Returns the value of attribute origin_class.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def origin_class
  @origin_class
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def path
  @path
end

#searchObject (readonly)

Returns the value of attribute search.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def search
  @search
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



5
6
7
# File 'lib/forty_facets/filter_definition.rb', line 5

def table_name
  @table_name
end

Instance Method Details

#qualified_column_nameObject



20
21
22
# File 'lib/forty_facets/filter_definition.rb', line 20

def qualified_column_name
  "#{table_name}.#{column_name}"
end

#request_paramObject



16
17
18
# File 'lib/forty_facets/filter_definition.rb', line 16

def request_param
  path.join('-')
end