Class: TrustyCms::AdminUI::NavSubItem
- Inherits:
-
Object
- Object
- TrustyCms::AdminUI::NavSubItem
- Defined in:
- lib/trusty_cms/admin_ui.rb
Overview
Simple structure for storing the properties of a tab’s sub items.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tab ⇒ Object
Returns the value of attribute tab.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(name, url = '#') ⇒ NavSubItem
constructor
A new instance of NavSubItem.
- #relative_url ⇒ Object
- #visible?(user) ⇒ Boolean
Constructor Details
#initialize(name, url = '#') ⇒ NavSubItem
Returns a new instance of NavSubItem.
83 84 85 86 |
# File 'lib/trusty_cms/admin_ui.rb', line 83 def initialize(name, url = '#') @name = name @url = url end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
80 81 82 |
# File 'lib/trusty_cms/admin_ui.rb', line 80 def name @name end |
#tab ⇒ Object
Returns the value of attribute tab.
81 82 83 |
# File 'lib/trusty_cms/admin_ui.rb', line 81 def tab @tab end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
80 81 82 |
# File 'lib/trusty_cms/admin_ui.rb', line 80 def url @url end |
Instance Method Details
#relative_url ⇒ Object
92 93 94 |
# File 'lib/trusty_cms/admin_ui.rb', line 92 def relative_url File.join(ActionController::Base.relative_url_root || '', url) end |
#visible?(user) ⇒ Boolean
88 89 90 |
# File 'lib/trusty_cms/admin_ui.rb', line 88 def visible?(user) visible_by_controller?(user) end |