Class: Trestle::Table::ActionsColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/trestle/table/actions_column.rb

Defined Under Namespace

Classes: ActionsBuilder, Renderer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, &block) ⇒ ActionsColumn



6
7
8
9
# File 'lib/trestle/table/actions_column.rb', line 6

def initialize(table, &block)
  @table = table
  @block = block_given? ? block : default_actions
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



4
5
6
# File 'lib/trestle/table/actions_column.rb', line 4

def block
  @block
end

#tableObject (readonly)

Returns the value of attribute table.



4
5
6
# File 'lib/trestle/table/actions_column.rb', line 4

def table
  @table
end

Instance Method Details

#default_actionsObject



15
16
17
18
19
# File 'lib/trestle/table/actions_column.rb', line 15

def default_actions
  ->(action) do
    action.delete
  end
end

#renderer(template) ⇒ Object



11
12
13
# File 'lib/trestle/table/actions_column.rb', line 11

def renderer(template)
  Renderer.new(self, template)
end