Class: BootstrapBuilders::Table
- Inherits:
-
Object
- Object
- BootstrapBuilders::Table
- Defined in:
- lib/bootstrap_builders/table.rb
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(args) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(args) ⇒ Table
Returns a new instance of Table.
2 3 4 5 6 |
# File 'lib/bootstrap_builders/table.rb', line 2 def initialize(args) @args = args @blk = args.fetch(:blk) @context = args.fetch(:context) end |
Instance Method Details
#html ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bootstrap_builders/table.rb', line 8 def html if @blk buffer = @context.content_tag(:table, attributes, &@blk) else buffer = @context.content_tag(:table, @content, attributes) end return buffer unless @args[:responsive] @context.content_tag(:div, buffer, class: "table-responsive") end |