Class: AjaxDatatablesRails::Datatable::SimpleOrder
- Inherits:
-
Object
- Object
- AjaxDatatablesRails::Datatable::SimpleOrder
- Defined in:
- lib/ajax-datatables-rails/datatable/simple_order.rb
Constant Summary collapse
- DIRECTIONS =
%w(DESC ASC)
Instance Attribute Summary collapse
-
#datatable ⇒ Object
readonly
Returns the value of attribute datatable.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #column ⇒ Object
-
#initialize(datatable, options) ⇒ SimpleOrder
constructor
A new instance of SimpleOrder.
- #query(sort_column) ⇒ Object
Constructor Details
#initialize(datatable, options) ⇒ SimpleOrder
Returns a new instance of SimpleOrder.
8 9 10 11 |
# File 'lib/ajax-datatables-rails/datatable/simple_order.rb', line 8 def initialize(datatable, ) @datatable = datatable @options = || {} end |
Instance Attribute Details
#datatable ⇒ Object (readonly)
Returns the value of attribute datatable.
4 5 6 |
# File 'lib/ajax-datatables-rails/datatable/simple_order.rb', line 4 def datatable @datatable end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/ajax-datatables-rails/datatable/simple_order.rb', line 4 def @options end |
Instance Method Details
#column ⇒ Object
17 18 19 |
# File 'lib/ajax-datatables-rails/datatable/simple_order.rb', line 17 def column datatable.column_by(:index, column_index) end |
#query(sort_column) ⇒ Object
13 14 15 |
# File 'lib/ajax-datatables-rails/datatable/simple_order.rb', line 13 def query sort_column "#{ sort_column } #{ dir }" end |