Sha256: 95346ac6228af9a2b549b57e4f90c99250792d558fedfd17e8b902c28dd377a3
Contents?: true
Size: 532 Bytes
Versions: 7
Compression:
Stored size: 532 Bytes
Contents
module TableSortable class Columns < Array def initialize super end def add(col_name, *options) options = options.extract_options! self << TableSortable::Column.new(col_name, options) end def sort_by(sort_key) if sort_key sort_key.map{|c| self.find{|col| (c.is_a?(String) ? (col.label == c) : col.name == c)}} else self end end def [](name) return self.find{|col| col.name == name.to_sym} if name.is_a? String super end end end
Version data entries
7 entries across 7 versions & 1 rubygems