Module: EasyTable::ViewExt::Util
- Included in:
- Cell
- Defined in:
- lib/easy-table/util.rb
Instance Method Summary collapse
- #class_option(id, options, cycle_options = {}) ⇒ Object
- #cycle_class(name = nil) ⇒ Object
- #get_class(*classes) ⇒ Object
Instance Method Details
#class_option(id, options, cycle_options = {}) ⇒ Object
7 8 9 10 |
# File 'lib/easy-table/util.rb', line 7 def class_option id, , ={} return {} if ![id] {:class => get_class([id], :name => [:name] || nil) } end |
#cycle_class(name = nil) ⇒ Object
23 24 25 |
# File 'lib/easy-table/util.rb', line 23 def cycle_class name=nil name ? cycle('odd', 'even', :name => name) : cycle('odd', 'even') end |
#get_class(*classes) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/easy-table/util.rb', line 12 def get_class *classes = last_option classes return cycle_class([:name]) if classes.blank? classes = [classes].flatten name = [:name] return cycle(*classes, :name => name) if name cycle(*classes) end |