Class: Pageflow::Admin::AttributesTableRows
- Inherits:
-
Object
- Object
- Pageflow::Admin::AttributesTableRows
- Defined in:
- lib/pageflow/admin/attributes_table_rows.rb
Overview
Instance Method Summary collapse
- #for(resource_name) ⇒ Object private
-
#initialize ⇒ AttributesTableRows
constructor
private
A new instance of AttributesTableRows.
-
#register(resource_name, name, options = {}) {|resource| ... } ⇒ Object
Insert an additional row into an attribute table.
Constructor Details
#initialize ⇒ AttributesTableRows
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of AttributesTableRows.
9 10 11 |
# File 'lib/pageflow/admin/attributes_table_rows.rb', line 9 def initialize @rows = {} end |
Instance Method Details
#for(resource_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/pageflow/admin/attributes_table_rows.rb', line 42 def for(resource_name) @rows.fetch(resource_name, []) end |
#register(resource_name, name, options = {}) {|resource| ... } ⇒ Object
Insert an additional row into an attribute table.
31 32 33 34 35 36 37 38 39 |
# File 'lib/pageflow/admin/attributes_table_rows.rb', line 31 def register(resource_name, name, = {}, &block) @rows[resource_name] ||= [] @rows[resource_name] << { name: name, block: block, options: .except(:before, :after), **.slice(:before, :after) } end |