Class: Arrow::SortOptions
- Inherits:
-
Object
- Object
- Arrow::SortOptions
- Defined in:
- lib/arrow/sort-options.rb
Class Method Summary collapse
- .try_convert(value) ⇒ Object private
Instance Method Summary collapse
-
#add_sort_key(target, order = nil) ⇒ void
Add a sort key.
- #add_sort_key_raw ⇒ Object private
-
#initialize(*sort_keys) ⇒ SortOptions
constructor
A new instance of SortOptions.
Constructor Details
#initialize(*sort_keys) ⇒ SortOptions
Returns a new instance of SortOptions.
59 60 61 62 63 64 |
# File 'lib/arrow/sort-options.rb', line 59 def initialize(*sort_keys) initialize_raw sort_keys.each do |sort_key| add_sort_key(sort_key) end end |
Class Method Details
.try_convert(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/arrow/sort-options.rb', line 22 def try_convert(value) case value when Symbol, String new(value) when ::Array new(*value) else nil end end |
Instance Method Details
#add_sort_key(key) ⇒ void #add_sort_key(target) ⇒ void #add_sort_key(target, order) ⇒ void
This method returns an undefined value.
Add a sort key.
105 106 107 |
# File 'lib/arrow/sort-options.rb', line 105 def add_sort_key(target, order=nil) add_sort_key_raw(SortKey.resolve(target, order)) end |
#add_sort_key_raw ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
67 |
# File 'lib/arrow/sort-options.rb', line 67 alias_method :add_sort_key_raw, :add_sort_key |