Class: Alchemy::Admin::Resource::Action

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/admin/resource/action.rb

Overview

Renders a container for a button, which evaluate CanCanCan and shows a tooltip. This is an internal component for the resource table, to make easier to read.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, tooltip = nil, resource = nil, &block) ⇒ Action

Returns a new instance of Action.



35
36
37
38
39
40
# File 'app/components/alchemy/admin/resource/action.rb', line 35

def initialize(name = nil, tooltip = nil, resource = nil, &block)
  @name = name
  @tooltip = tooltip
  @resource = resource
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



21
22
23
# File 'app/components/alchemy/admin/resource/action.rb', line 21

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'app/components/alchemy/admin/resource/action.rb', line 21

def name
  @name
end

#tooltipObject (readonly)

Returns the value of attribute tooltip.



21
22
23
# File 'app/components/alchemy/admin/resource/action.rb', line 21

def tooltip
  @tooltip
end