Class: Phlexi::Table::Components::ActionsColumn
Instance Attribute Summary
Attributes inherited from Base
#key, #options, #parent
Instance Method Summary
collapse
#colspan, #header_cell, #header_cell_attributes
Constructor Details
Returns a new instance of ActionsColumn.
9
10
11
12
13
14
|
# File 'lib/phlexi/table/components/actions_column.rb', line 9
def initialize(*, **, &block)
raise ArgumentError, "block is required" unless block.present?
super(*, **)
@block = block
end
|
Instance Method Details
#alignment ⇒ Object
39
|
# File 'lib/phlexi/table/components/actions_column.rb', line 39
def alignment = nil
|
#data_cell_attributes(object) ⇒ Object
33
34
35
|
# File 'lib/phlexi/table/components/actions_column.rb', line 33
def data_cell_attributes(object)
@attributes
end
|
#dom_id ⇒ Object
29
30
31
|
# File 'lib/phlexi/table/components/actions_column.rb', line 29
def dom_id
"#{super}_actions_cell"
end
|
#label(label = nil) ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/phlexi/table/components/actions_column.rb', line 16
def label(label = nil)
if label.nil?
options[:label]
else
options[:label] = label
self
end
end
|
#render_actions(object) ⇒ Object
25
26
27
|
# File 'lib/phlexi/table/components/actions_column.rb', line 25
def render_actions(object)
@block.call(object)
end
|
#type ⇒ Object
37
|
# File 'lib/phlexi/table/components/actions_column.rb', line 37
def type = "actions"
|