Class: Bootstrap5RailsExtensions::TableHelper::TableBuilder
- Inherits:
-
Object
- Object
- Bootstrap5RailsExtensions::TableHelper::TableBuilder
- Defined in:
- app/helpers/bootstrap5_rails_extensions/table_helper.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(view_context) ⇒ TableBuilder
constructor
A new instance of TableBuilder.
- #render ⇒ Object
- #tbody(**options, &block) ⇒ Object
- #thead(**options, &block) ⇒ Object
Constructor Details
#initialize(view_context) ⇒ TableBuilder
Returns a new instance of TableBuilder.
60 61 62 63 |
# File 'app/helpers/bootstrap5_rails_extensions/table_helper.rb', line 60 def initialize(view_context) @view = view_context @sections = [] end |
Instance Method Details
#empty? ⇒ Boolean
79 80 81 |
# File 'app/helpers/bootstrap5_rails_extensions/table_helper.rb', line 79 def empty? @sections.empty? end |
#render ⇒ Object
75 76 77 |
# File 'app/helpers/bootstrap5_rails_extensions/table_helper.rb', line 75 def render @view.safe_join(@sections) end |
#tbody(**options, &block) ⇒ Object
70 71 72 73 |
# File 'app/helpers/bootstrap5_rails_extensions/table_helper.rb', line 70 def tbody(**, &block) append_section(:tbody, , block) self end |
#thead(**options, &block) ⇒ Object
65 66 67 68 |
# File 'app/helpers/bootstrap5_rails_extensions/table_helper.rb', line 65 def thead(**, &block) append_section(:thead, , block) self end |