Class: Queryko::Filters::Base
- Inherits:
-
Object
- Object
- Queryko::Filters::Base
- Defined in:
- lib/queryko/filters/base.rb
Instance Attribute Summary collapse
-
#as ⇒ Object
readonly
Returns the value of attribute as.
-
#column_name ⇒ Object
readonly
Returns the value of attribute column_name.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#query_object ⇒ Object
readonly
Returns the value of attribute query_object.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #call(collection, token, query_object) ⇒ Object
-
#initialize(options = {}, feature) ⇒ Base
constructor
A new instance of Base.
- #param_key_format ⇒ Object
Constructor Details
#initialize(options = {}, feature) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 |
# File 'lib/queryko/filters/base.rb', line 6 def initialize( = {}, feature) @feature = feature @table_name = [:table_name] @column_name = .fetch(:column_name) { @feature.name } @as = [:as] end |
Instance Attribute Details
#as ⇒ Object (readonly)
Returns the value of attribute as.
4 5 6 |
# File 'lib/queryko/filters/base.rb', line 4 def as @as end |
#column_name ⇒ Object (readonly)
Returns the value of attribute column_name.
4 5 6 |
# File 'lib/queryko/filters/base.rb', line 4 def column_name @column_name end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
4 5 6 |
# File 'lib/queryko/filters/base.rb', line 4 def feature @feature end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/queryko/filters/base.rb', line 4 def field @field end |
#query_object ⇒ Object (readonly)
Returns the value of attribute query_object.
4 5 6 |
# File 'lib/queryko/filters/base.rb', line 4 def query_object @query_object end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
4 5 6 |
# File 'lib/queryko/filters/base.rb', line 4 def table_name @table_name end |
Instance Method Details
#call(collection, token, query_object) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/queryko/filters/base.rb', line 13 def call(collection, token, query_object) @query_object = query_object @table_name ||= query_object.class.table_name perform(collection, token, query_object) end |
#param_key_format ⇒ Object
24 25 26 |
# File 'lib/queryko/filters/base.rb', line 24 def param_key_format nil end |