Class: Maglev::Uikit::PageActionsDropdownComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Maglev::Uikit::PageActionsDropdownComponent
- Defined in:
- app/components/maglev/uikit/page_actions_dropdown_component.rb
Instance Attribute Summary collapse
-
#icon_direction ⇒ Object
readonly
Returns the value of attribute icon_direction.
-
#live_url ⇒ Object
readonly
Returns the value of attribute live_url.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#without_actions ⇒ Object
readonly
Returns the value of attribute without_actions.
Instance Method Summary collapse
- #allow?(action) ⇒ Boolean
- #icon_name ⇒ Object
-
#initialize(paths:, live_url:, without_actions: [], icon_direction: :vertical) ⇒ PageActionsDropdownComponent
constructor
A new instance of PageActionsDropdownComponent.
Methods inherited from BaseComponent
Constructor Details
#initialize(paths:, live_url:, without_actions: [], icon_direction: :vertical) ⇒ PageActionsDropdownComponent
Returns a new instance of PageActionsDropdownComponent.
8 9 10 11 12 13 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 8 def initialize(paths:, live_url:, without_actions: [], icon_direction: :vertical) @paths = paths @live_url = live_url @without_actions = without_actions @icon_direction = icon_direction end |
Instance Attribute Details
#icon_direction ⇒ Object (readonly)
Returns the value of attribute icon_direction.
6 7 8 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 6 def icon_direction @icon_direction end |
#live_url ⇒ Object (readonly)
Returns the value of attribute live_url.
6 7 8 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 6 def live_url @live_url end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
6 7 8 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 6 def paths @paths end |
#without_actions ⇒ Object (readonly)
Returns the value of attribute without_actions.
6 7 8 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 6 def without_actions @without_actions end |
Instance Method Details
#allow?(action) ⇒ Boolean
15 16 17 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 15 def allow?(action) !without_actions.include?(action) end |
#icon_name ⇒ Object
19 20 21 |
# File 'app/components/maglev/uikit/page_actions_dropdown_component.rb', line 19 def icon_name icon_direction == :vertical ? 'more_2' : 'more' end |