Module: Cheveret::Helper
- Defined in:
- lib/cheveret/helper.rb
Instance Method Summary collapse
- #cheveret_body(table, options = {}) ⇒ Object
- #cheveret_head(table, options) ⇒ Object
- #cheveret_rows(table, options = {}) ⇒ Object
- #cheveret_table(table, options = {}) ⇒ Object
Instance Method Details
#cheveret_body(table, options = {}) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/cheveret/helper.rb', line 54 def cheveret_body(table, ={}) table.template = self .keys.each do |option| table.send(:"#{option}=", .delete(option)) if table.respond_to?(:"#{option}=") end table.render_tbody() end |
#cheveret_head(table, options) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/cheveret/helper.rb', line 42 def cheveret_head(table, ) table.template = self .keys.each do |option| table.send(:"#{option}=", .delete(option)) if table.respond_to?(:"#{option}=") end table.render_thead() end |
#cheveret_rows(table, options = {}) ⇒ Object
66 67 68 69 70 71 72 73 |
# File 'lib/cheveret/helper.rb', line 66 def cheveret_rows(table, ={}) table.template = self .keys.each do |option| table.send(:"#{option}=", .delete(option)) if table.respond_to?(:"#{option}=") end table.render_rows() end |
#cheveret_table(table, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/cheveret/helper.rb', line 30 def cheveret_table(table, ={}) table.template = self .keys.each do |option| table.send(:"#{option}=", .delete(option)) if table.respond_to?(:"#{option}=") end table.render_table() end |