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.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/admino/query/configuration.rb', line 63 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.
61 62 63 |
# File 'lib/admino/query/configuration.rb', line 61 def default_direction @default_direction end |
#default_scope ⇒ Object (readonly)
Returns the value of attribute default_scope.
60 61 62 |
# File 'lib/admino/query/configuration.rb', line 60 def default_scope @default_scope end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
59 60 61 |
# File 'lib/admino/query/configuration.rb', line 59 def scopes @scopes end |