Class: Maglev::Uikit::Breadcrumbs::LinkComponent
- Inherits:
-
Maglev::Uikit::BaseComponent
- Object
- ViewComponent::Base
- Maglev::Uikit::BaseComponent
- Maglev::Uikit::Breadcrumbs::LinkComponent
- Defined in:
- app/components/maglev/uikit/breadcrumbs/link_component.rb
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #icon? ⇒ Boolean
-
#initialize(label:, url: nil, icon: nil) ⇒ LinkComponent
constructor
A new instance of LinkComponent.
- #url? ⇒ Boolean
Methods inherited from Maglev::Uikit::BaseComponent
Constructor Details
#initialize(label:, url: nil, icon: nil) ⇒ LinkComponent
Returns a new instance of LinkComponent.
9 10 11 12 13 |
# File 'app/components/maglev/uikit/breadcrumbs/link_component.rb', line 9 def initialize(label:, url: nil, icon: nil) @label = label @icon = icon @url = url end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
7 8 9 |
# File 'app/components/maglev/uikit/breadcrumbs/link_component.rb', line 7 def icon @icon end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
7 8 9 |
# File 'app/components/maglev/uikit/breadcrumbs/link_component.rb', line 7 def label @label end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'app/components/maglev/uikit/breadcrumbs/link_component.rb', line 7 def url @url end |
Instance Method Details
#icon? ⇒ Boolean
19 20 21 |
# File 'app/components/maglev/uikit/breadcrumbs/link_component.rb', line 19 def icon? icon.present? end |
#url? ⇒ Boolean
15 16 17 |
# File 'app/components/maglev/uikit/breadcrumbs/link_component.rb', line 15 def url? url.present? end |