Class: Kadmin::Navbar::Link

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Presentable

#present

Constructor Details

#initialize(text:, path:, engine: nil, css_classes: []) ⇒ Rails::Application



26
27
28
29
30
31
# File 'app/components/kadmin/navbar/link.rb', line 26

def initialize(text:, path:, engine: nil, css_classes: [])
  @text = text.freeze
  @path = path.freeze
  @css_classes = Array.wrap(css_classes).dup.freeze
  @engine = engine || Rails.application
end

Instance Attribute Details

#css_classesArray<String> (readonly)



17
18
19
# File 'app/components/kadmin/navbar/link.rb', line 17

def css_classes
  @css_classes
end

#engineRails::Engine (readonly)



20
21
22
# File 'app/components/kadmin/navbar/link.rb', line 20

def engine
  @engine
end

#pathString (readonly)



14
15
16
# File 'app/components/kadmin/navbar/link.rb', line 14

def path
  @path
end

#textString (readonly)



11
12
13
# File 'app/components/kadmin/navbar/link.rb', line 11

def text
  @text
end