Class: Primrose::Components::Table
- Defined in:
- lib/primrose/components/table.rb
Constant Summary collapse
- TEMPLATE =
<<~ERB <table> <thead> <tr> <% @headers.each do |header| %> <th><%= header %></th> <% end %> </tr> </thead> <tbody> <% @rows.each do |row| %> <tr> <% row.each do |cell| %> <td><%= cell %></td> <% end %> </tr> <% end %> </tbody> </table> ERB
Instance Attribute Summary
Attributes inherited from Rose
#children, #event_handlers, #state
Instance Method Summary collapse
-
#initialize(headers, rows) ⇒ Table
constructor
A new instance of Table.
- #render ⇒ Object
Methods inherited from Rose
#add_child, #get_binding, #handle_error, #lifecycle, #on, #render_children, #trigger
Constructor Details
#initialize(headers, rows) ⇒ Table
Returns a new instance of Table.
25 26 27 28 |
# File 'lib/primrose/components/table.rb', line 25 def initialize(headers, rows) @headers = headers @rows = rows end |