Class: Alchemy::Admin::Resource::Action
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Alchemy::Admin::Resource::Action
- 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
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tooltip ⇒ Object
readonly
Returns the value of attribute tooltip.
Instance Method Summary collapse
-
#initialize(name = nil, tooltip = nil, &block) ⇒ Action
constructor
A new instance of Action.
- #with_resource(resource) ⇒ Object
Constructor Details
#initialize(name = nil, tooltip = nil, &block) ⇒ Action
Returns a new instance of Action.
33 34 35 36 37 |
# File 'app/components/alchemy/admin/resource/action.rb', line 33 def initialize(name = nil, tooltip = nil, &block) @name = name @tooltip = tooltip @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
19 20 21 |
# File 'app/components/alchemy/admin/resource/action.rb', line 19 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'app/components/alchemy/admin/resource/action.rb', line 19 def name @name end |
#tooltip ⇒ Object (readonly)
Returns the value of attribute tooltip.
19 20 21 |
# File 'app/components/alchemy/admin/resource/action.rb', line 19 def tooltip @tooltip end |
Instance Method Details
#with_resource(resource) ⇒ Object
39 40 41 42 |
# File 'app/components/alchemy/admin/resource/action.rb', line 39 def with_resource(resource) @resource = resource self end |