Class: Btgen::BootstrapTable
- Inherits:
-
Object
- Object
- Btgen::BootstrapTable
- Includes:
- ActionView::Context, ActionView::Helpers::TagHelper
- Defined in:
- lib/btgen/bootstrap_table.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#rows ⇒ Object
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(args) ⇒ BootstrapTable
constructor
A new instance of BootstrapTable.
- #to_html ⇒ Object
Constructor Details
#initialize(args) ⇒ BootstrapTable
7 8 9 10 11 12 13 |
# File 'lib/btgen/bootstrap_table.rb', line 7 def initialize(args) @args = args args[:class] = "table table-striped #{args[:class]}".split(' ').sort.uniq @headers = [] @rows = [] end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/btgen/bootstrap_table.rb', line 6 def headers @headers end |
#rows ⇒ Object
Returns the value of attribute rows.
6 7 8 |
# File 'lib/btgen/bootstrap_table.rb', line 6 def rows @rows end |
Instance Method Details
#to_html ⇒ Object
15 16 17 18 19 |
# File 'lib/btgen/bootstrap_table.rb', line 15 def to_html content_tag :table, @args do build_headers + build_body end end |