Class: Glib::JsonUi::ListBuilders::Section
- Inherits:
-
AbstractBuilder
- Object
- AbstractBuilder
- Glib::JsonUi::ListBuilders::Section
- Defined in:
- app/helpers/glib/json_ui/list_builders.rb
Instance Attribute Summary
Attributes inherited from AbstractBuilder
Instance Method Summary collapse
- #footer(options = {}) ⇒ Object
- #header(options = {}) ⇒ Object
-
#initialize(json, page, template) ⇒ Section
constructor
A new instance of Section.
- #rows(options = {}) ⇒ Object
Constructor Details
#initialize(json, page, template) ⇒ Section
Returns a new instance of Section.
33 34 35 36 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 33 def initialize json, page, template super json, page @template = template end |
Instance Method Details
#footer(options = {}) ⇒ Object
57 58 59 60 61 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 57 def ( = {}) json. do page.vertical_content() end end |
#header(options = {}) ⇒ Object
38 39 40 41 42 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 38 def header( = {}) json.header do page.vertical_content() end end |
#rows(options = {}) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 44 def rows( = {}) block = [:builder] json.rows do if (objects = [:objects]) objects.each_with_index do |object, index| block&.call @template, object, index end else block&.call @template end end end |