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.
83 84 85 86 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 83 def initialize(json, page, template) super json, page @template = template end |
Instance Method Details
#footer(options = {}) ⇒ Object
107 108 109 110 111 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 107 def ( = {}) json. do page.vertical_content() end end |
#header(options = {}) ⇒ Object
88 89 90 91 92 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 88 def header( = {}) json.header do page.vertical_content() end end |
#rows(options = {}) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'app/helpers/glib/json_ui/list_builders.rb', line 94 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 |