Class: Irelia::Sidebar::Navigation::Link::Component
- Inherits:
-
Component
- Object
- Component
- Irelia::Sidebar::Navigation::Link::Component
- Defined in:
- app/components/irelia/sidebar/navigation/link/component.rb
Instance Method Summary collapse
-
#initialize(**options) ⇒ Component
constructor
A new instance of Component.
- #tag_helper(*args, &block) ⇒ Object
- #variants ⇒ Object
Constructor Details
#initialize(**options) ⇒ Component
Returns a new instance of Component.
21 22 23 24 25 |
# File 'app/components/irelia/sidebar/navigation/link/component.rb', line 21 def initialize(**) super @html_options[:method] = @method if @method != :get end |
Instance Method Details
#tag_helper(*args, &block) ⇒ Object
9 10 11 |
# File 'app/components/irelia/sidebar/navigation/link/component.rb', line 9 def tag_helper(*args, &block) method == :get ? link_to(*args, &block) : (*args, &block) end |
#variants ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/components/irelia/sidebar/navigation/link/component.rb', line 13 def variants class_names( "irelia-sidebar__navigation__link", "irelia-sidebar__navigation__link--default": variant == :default, "irelia-sidebar__navigation__link--active": active ) end |