Method: Forma::Table#initialize

Defined in:
lib/forma/table.rb

#initialize(h = {}) ⇒ Table

Returns a new instance of Table.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/forma/table.rb', line 11

def initialize(h = {})
  h = h.symbolize_keys
  @id = h[:id]
  # title properties
  @title = h[:title]
  @icon = h[:icon]
  @collapsible = h[:collapsible]
  @collapsed = h[:collapsed]
  # values and fields
  @models = h[:models]
  @fields = h[:fields] || []
  @paginate = h[:paginate]
  # actions
  @title_actions = h[:title_actions] || []
  @item_actions = h[:item_actions] || []
  # row class
  @row_class = h[:row_class]
  @checkboxes = h[:checkboxes]
  # context
  @context = h[:context]
end