Class: ActionAdmin::Table
- Inherits:
-
Object
- Object
- ActionAdmin::Table
- Defined in:
- lib/action_admin/table.rb
Instance Method Summary collapse
- #column(name, options = {}) ⇒ Object
-
#initialize(name, options) ⇒ Table
constructor
A new instance of Table.
- #merge(table) ⇒ Object
Constructor Details
#initialize(name, options) ⇒ Table
Returns a new instance of Table.
8 9 10 11 12 13 |
# File 'lib/action_admin/table.rb', line 8 def initialize(name, ) self.name = name self. = self.columns = {} self.header = {} end |
Instance Method Details
#column(name, options = {}) ⇒ Object
15 16 17 18 |
# File 'lib/action_admin/table.rb', line 15 def column(name, ={}) self.columns = self.columns.merge(name => ) self.header = self.header.merge(name => set_column_header(name, )) end |
#merge(table) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/action_admin/table.rb', line 20 def merge(table) if table.is_a? ActionAdmin::Table self. = table..deep_merge(self.) self.columns = table.columns.merge(self.columns) self.header = table.header.merge(self.header) end end |