Class: Admino::Query::Configuration::FilterGroup
- Inherits:
-
Object
- Object
- Admino::Query::Configuration::FilterGroup
- Defined in:
- lib/admino/query/configuration.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
Instance Method Summary collapse
- #default_scope ⇒ Object
- #include_empty_scope? ⇒ Boolean
-
#initialize(name, scopes, options = {}) ⇒ FilterGroup
constructor
A new instance of FilterGroup.
Constructor Details
#initialize(name, scopes, options = {}) ⇒ FilterGroup
Returns a new instance of FilterGroup.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/admino/query/configuration.rb', line 35 def initialize(name, scopes, = {}) .symbolize_keys! .assert_valid_keys( :include_empty_scope, :default ) @name = name.to_sym @scopes = scopes.map(&:to_sym) @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/admino/query/configuration.rb', line 31 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
33 34 35 |
# File 'lib/admino/query/configuration.rb', line 33 def @options end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
32 33 34 |
# File 'lib/admino/query/configuration.rb', line 32 def scopes @scopes end |
Instance Method Details
#default_scope ⇒ Object
51 52 53 54 55 |
# File 'lib/admino/query/configuration.rb', line 51 def default_scope if [:default] [:default].to_sym end end |
#include_empty_scope? ⇒ Boolean
47 48 49 |
# File 'lib/admino/query/configuration.rb', line 47 def include_empty_scope? @options.fetch(:include_empty_scope) { false } end |