Class: GestartAdmino::Query::Configuration::FilterGroup
- Inherits:
-
Object
- Object
- GestartAdmino::Query::Configuration::FilterGroup
- Defined in:
- lib/gestart_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.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/gestart_admino/query/configuration.rb', line 28 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.
24 25 26 |
# File 'lib/gestart_admino/query/configuration.rb', line 24 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
26 27 28 |
# File 'lib/gestart_admino/query/configuration.rb', line 26 def @options end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
25 26 27 |
# File 'lib/gestart_admino/query/configuration.rb', line 25 def scopes @scopes end |
Instance Method Details
#default_scope ⇒ Object
44 45 46 47 48 |
# File 'lib/gestart_admino/query/configuration.rb', line 44 def default_scope if [:default] [:default].to_sym end end |
#include_empty_scope? ⇒ Boolean
40 41 42 |
# File 'lib/gestart_admino/query/configuration.rb', line 40 def include_empty_scope? @options.fetch(:include_empty_scope) { false } end |