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