Module: Cheveret::Helper

Defined in:
lib/cheveret/helper.rb

Instance Method Summary collapse

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, options={})
  table.template = self
  options.keys.each do |option|
    table.send(:"#{option}=", options.delete(option)) if table.respond_to?(:"#{option}=")
  end

  table.render_tbody(options)
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, options)
  table.template = self
  options.keys.each do |option|
    table.send(:"#{option}=", options.delete(option)) if table.respond_to?(:"#{option}=")
  end

  table.render_thead(options)
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, options={})
  table.template = self
  options.keys.each do |option|
    table.send(:"#{option}=", options.delete(option)) if table.respond_to?(:"#{option}=")
  end

  table.render_rows(options)
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, options={})
  table.template = self
  options.keys.each do |option|
    table.send(:"#{option}=", options.delete(option)) if table.respond_to?(:"#{option}=")
  end

  table.render_table(options)
end