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) ⇒ 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.
56 57 58 59 |
# File 'lib/admino/query/configuration.rb', line 56 def initialize @search_fields = [] @filter_groups = [] end |
Instance Attribute Details
#ending_scope_callable ⇒ Object
Returns the value of attribute ending_scope_callable.
54 55 56 |
# File 'lib/admino/query/configuration.rb', line 54 def ending_scope_callable @ending_scope_callable end |
#filter_groups ⇒ Object (readonly)
Returns the value of attribute filter_groups.
51 52 53 |
# File 'lib/admino/query/configuration.rb', line 51 def filter_groups @filter_groups end |
#search_fields ⇒ Object (readonly)
Returns the value of attribute search_fields.
50 51 52 |
# File 'lib/admino/query/configuration.rb', line 50 def search_fields @search_fields end |
#sorting ⇒ Object (readonly)
Returns the value of attribute sorting.
52 53 54 |
# File 'lib/admino/query/configuration.rb', line 52 def sorting @sorting end |
#starting_scope_callable ⇒ Object
Returns the value of attribute starting_scope_callable.
53 54 55 |
# File 'lib/admino/query/configuration.rb', line 53 def starting_scope_callable @starting_scope_callable end |
Instance Method Details
#add_filter_group(name, scopes) ⇒ Object
67 68 69 70 71 |
# File 'lib/admino/query/configuration.rb', line 67 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
61 62 63 64 65 |
# File 'lib/admino/query/configuration.rb', line 61 def add_search_field(name, = {}) SearchField.new(name, ).tap do |search_field| self.search_fields << search_field end end |
#add_sorting_scopes(scopes, options = {}) ⇒ Object
73 74 75 |
# File 'lib/admino/query/configuration.rb', line 73 def add_sorting_scopes(scopes, = {}) @sorting = Sorting.new(scopes, ) end |