Class: Radiant::AdminUI::NavSubItem
- Inherits:
-
Object
- Object
- Radiant::AdminUI::NavSubItem
- Defined in:
- lib/radiant/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.
85 86 87 |
# File 'lib/radiant/admin_ui.rb', line 85 def initialize(name, url = "#") @name, @url = name, url end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
82 83 84 |
# File 'lib/radiant/admin_ui.rb', line 82 def name @name end |
#tab ⇒ Object
Returns the value of attribute tab.
83 84 85 |
# File 'lib/radiant/admin_ui.rb', line 83 def tab @tab end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
82 83 84 |
# File 'lib/radiant/admin_ui.rb', line 82 def url @url end |
Instance Method Details
#relative_url ⇒ Object
93 94 95 |
# File 'lib/radiant/admin_ui.rb', line 93 def relative_url File.join('', url) end |
#visible?(user) ⇒ Boolean
89 90 91 |
# File 'lib/radiant/admin_ui.rb', line 89 def visible?(user) visible_by_controller?(user) end |