Class: Uchi::Ui::Actions::Dropdown
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Uchi::Ui::Actions::Dropdown
- Defined in:
- app/components/uchi/ui/actions/dropdown.rb
Overview
Renders a dropdown menu of actions that can be performed on a record.
This component displays available actions for a repository in a dropdown menu. Each action can be clicked to execute it on the specified record(s).
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
-
#initialize(actions:, record:, repository:) ⇒ Dropdown
constructor
A new instance of Dropdown.
- #render? ⇒ Boolean
Constructor Details
#initialize(actions:, record:, repository:) ⇒ Dropdown
Returns a new instance of Dropdown.
13 14 15 16 17 18 |
# File 'app/components/uchi/ui/actions/dropdown.rb', line 13 def initialize(actions:, record:, repository:) super() @actions = actions @record = record @repository = repository end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
11 12 13 |
# File 'app/components/uchi/ui/actions/dropdown.rb', line 11 def actions @actions end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
11 12 13 |
# File 'app/components/uchi/ui/actions/dropdown.rb', line 11 def record @record end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
11 12 13 |
# File 'app/components/uchi/ui/actions/dropdown.rb', line 11 def repository @repository end |
Instance Method Details
#render? ⇒ Boolean
20 21 22 |
# File 'app/components/uchi/ui/actions/dropdown.rb', line 20 def render? actions.any? end |