Class: Admino::Query::Configuration
- Inherits:
-
Object
- Object
- Admino::Query::Configuration
- Defined in:
- lib/admino/query/configuration.rb
Defined Under Namespace
Classes: FilterGroup, SearchField, Sorting
Instance Attribute Summary collapse
-
#ending_scope_callable ⇒ Object
Returns the value of attribute ending_scope_callable.
-
#filter_groups ⇒ Object
readonly
Returns the value of attribute filter_groups.
-
#search_fields ⇒ Object
readonly
Returns the value of attribute search_fields.
-
#sorting ⇒ Object
readonly
Returns the value of attribute sorting.
-
#starting_scope_callable ⇒ Object
Returns the value of attribute starting_scope_callable.
Instance Method Summary collapse
- #add_filter_group(name, scopes, options = {}) ⇒ Object
- #add_search_field(name, options = {}) ⇒ Object
- #add_sorting_scopes(scopes, options = {}) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
84 85 86 87 |
# File 'lib/admino/query/configuration.rb', line 84 def initialize @search_fields = [] @filter_groups = [] end |
Instance Attribute Details
#ending_scope_callable ⇒ Object
Returns the value of attribute ending_scope_callable.
82 83 84 |
# File 'lib/admino/query/configuration.rb', line 82 def ending_scope_callable @ending_scope_callable end |
#filter_groups ⇒ Object (readonly)
Returns the value of attribute filter_groups.
79 80 81 |
# File 'lib/admino/query/configuration.rb', line 79 def filter_groups @filter_groups end |
#search_fields ⇒ Object (readonly)
Returns the value of attribute search_fields.
78 79 80 |
# File 'lib/admino/query/configuration.rb', line 78 def search_fields @search_fields end |
#sorting ⇒ Object (readonly)
Returns the value of attribute sorting.
80 81 82 |
# File 'lib/admino/query/configuration.rb', line 80 def sorting @sorting end |
#starting_scope_callable ⇒ Object
Returns the value of attribute starting_scope_callable.
81 82 83 |
# File 'lib/admino/query/configuration.rb', line 81 def starting_scope_callable @starting_scope_callable end |
Instance Method Details
#add_filter_group(name, scopes, options = {}) ⇒ Object
95 96 97 98 99 |
# File 'lib/admino/query/configuration.rb', line 95 def add_filter_group(name, scopes, = {}) FilterGroup.new(name, scopes, ).tap do |filter_group| self.filter_groups << filter_group end end |
#add_search_field(name, options = {}) ⇒ Object
89 90 91 92 93 |
# File 'lib/admino/query/configuration.rb', line 89 def add_search_field(name, = {}) SearchField.new(name, ).tap do |search_field| self.search_fields << search_field end end |