Class: SimpleModelView::CollectionTableBuilder
- Inherits:
-
Object
- Object
- SimpleModelView::CollectionTableBuilder
- Includes:
- BuilderHelpers, TemplateHelpers
- Defined in:
- lib/simple_model_view/collection_table_builder.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
Instance Method Summary collapse
- #columns_builder ⇒ Object
-
#initialize(template, collection, *_args, formatter: SimpleModelView.formatter) ⇒ CollectionTableBuilder
constructor
A new instance of CollectionTableBuilder.
- #row_builder_for(resource) ⇒ Object
Methods included from BuilderHelpers
Methods included from TemplateHelpers
#blank_span, #block_concat, #merge_html_attrs
Constructor Details
#initialize(template, collection, *_args, formatter: SimpleModelView.formatter) ⇒ CollectionTableBuilder
Returns a new instance of CollectionTableBuilder.
8 9 10 11 12 |
# File 'lib/simple_model_view/collection_table_builder.rb', line 8 def initialize(template, collection, *_args, formatter: SimpleModelView.formatter) @template = template @collection = collection @formatter = formatter end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
14 15 16 |
# File 'lib/simple_model_view/collection_table_builder.rb', line 14 def collection @collection end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
14 15 16 |
# File 'lib/simple_model_view/collection_table_builder.rb', line 14 def formatter @formatter end |
Instance Method Details
#columns_builder ⇒ Object
16 17 18 |
# File 'lib/simple_model_view/collection_table_builder.rb', line 16 def columns_builder CollectionTableHeaderBuilder.new template, collection end |
#row_builder_for(resource) ⇒ Object
20 21 22 |
# File 'lib/simple_model_view/collection_table_builder.rb', line 20 def row_builder_for(resource) CollectionTableRowBuilder.new template, resource, formatter: formatter end |