Class: TableColumnComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
lib/alveole/components/table_column_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(value: nil, obj: nil, fieldname: nil, url: nil, options: {}) ⇒ TableColumnComponent

Returns a new instance of TableColumnComponent.



2
3
4
5
6
7
8
9
10
11
# File 'lib/alveole/components/table_column_component.rb', line 2

def initialize(value: nil, obj: nil, fieldname: nil, url: nil, options: {})
  super

  @obj = obj
  @fieldname = fieldname
  @value = value || obj&.send(fieldname)
  @value = ApplicationController.helpers.format_value(@value, options)
  @url = url
  @options = options
end