Class: Btgen::BootstrapTable

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::TagHelper
Defined in:
lib/btgen/bootstrap_table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'lib/btgen/bootstrap_table.rb', line 6

def headers
  @headers
end

#rowsObject

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_htmlObject



15
16
17
18
19
# File 'lib/btgen/bootstrap_table.rb', line 15

def to_html
   :table, @args do
    build_headers + build_body
  end
end