Class: AdminCore::ViewObject::SidebarLink
- Inherits:
-
Object
- Object
- AdminCore::ViewObject::SidebarLink
- Defined in:
- lib/admin_core/view_object/sidebar_link.rb
Instance Method Summary collapse
-
#initialize(name, link, external = false) ⇒ SidebarLink
constructor
A new instance of SidebarLink.
- #to_hash ⇒ Object
Constructor Details
#initialize(name, link, external = false) ⇒ SidebarLink
Returns a new instance of SidebarLink.
7 8 9 10 11 |
# File 'lib/admin_core/view_object/sidebar_link.rb', line 7 def initialize(name, link, external = false) @name = name @link = link @external = external end |
Instance Method Details
#to_hash ⇒ Object
Note:
Implements SidebarLink flow type
14 15 16 17 18 19 20 21 |
# File 'lib/admin_core/view_object/sidebar_link.rb', line 14 def to_hash { displayName: @name, link: @link, external: @link =~ %r{://} || @external, type: 'link' } end |