Class: TableSortable::Column::Sorter
Instance Method Summary
collapse
#detect_method, #disabled?
Constructor Details
#initialize(*options) ⇒ Sorter
Returns a new instance of Sorter.
6
7
8
|
# File 'lib/table_sortable/column/sorter.rb', line 6
def initialize(*options)
super :sort, *options
end
|
Instance Method Details
#array_proc ⇒ Object
10
11
12
|
# File 'lib/table_sortable/column/sorter.rb', line 10
def array_proc
-> (col=nil) { sort{ |a,b| col.value(a) <=> col.value(b) }}
end
|
#sql_proc ⇒ Object
14
15
16
|
# File 'lib/table_sortable/column/sorter.rb', line 14
def sql_proc
-> (col=nil) { order(sorter) }
end
|