Class: Kadmin::Navbar::Link
- Inherits:
-
Object
- Object
- Kadmin::Navbar::Link
- Includes:
- Presentable
- Defined in:
- app/components/kadmin/navbar/link.rb
Overview
A navigation link for use with the navbar items
Defined Under Namespace
Classes: Presenter
Instance Attribute Summary collapse
-
#css_classes ⇒ Array<String>
readonly
List of additional CSS classes.
-
#path ⇒ String
readonly
Supports dynamic paths by setting the base property as a Proc.
-
#text ⇒ String
readonly
Text of the link.
Instance Method Summary collapse
-
#initialize(text:, path:, css_classes: []) ⇒ Link
constructor
A new instance of Link.
Methods included from Presentable
Constructor Details
#initialize(text:, path:, css_classes: []) ⇒ Link
Returns a new instance of Link
20 21 22 23 24 |
# File 'app/components/kadmin/navbar/link.rb', line 20 def initialize(text:, path:, css_classes: []) @text = text.freeze @path = path.freeze @css_classes = Array.wrap(css_classes).dup.freeze end |
Instance Attribute Details
#css_classes ⇒ Array<String> (readonly)
Returns list of additional CSS classes
15 16 17 |
# File 'app/components/kadmin/navbar/link.rb', line 15 def css_classes @css_classes end |
#path ⇒ String (readonly)
Supports dynamic paths by setting the base property as a Proc
12 13 14 |
# File 'app/components/kadmin/navbar/link.rb', line 12 def path @path end |
#text ⇒ String (readonly)
Returns text of the link
9 10 11 |
# File 'app/components/kadmin/navbar/link.rb', line 9 def text @text end |