Class: Radiant::AdminUI::NavSubItem
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.
-
#proper_name ⇒ Object
readonly
Returns the value of attribute proper_name.
-
#tab ⇒ Object
Returns the value of attribute tab.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(name, proper_name, url = "#") ⇒ NavSubItem
constructor
A new instance of NavSubItem.
- #relative_url ⇒ Object
- #visible?(user) ⇒ Boolean
Constructor Details
#initialize(name, proper_name, url = "#") ⇒ NavSubItem
Returns a new instance of NavSubItem.
67 68 69 |
# File 'lib/radiant/admin_ui.rb', line 67 def initialize(name, proper_name, url = "#") @name, @proper_name, @url = name, proper_name, url end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
64 65 66 |
# File 'lib/radiant/admin_ui.rb', line 64 def name @name end |
#proper_name ⇒ Object (readonly)
Returns the value of attribute proper_name.
64 65 66 |
# File 'lib/radiant/admin_ui.rb', line 64 def proper_name @proper_name end |
#tab ⇒ Object
Returns the value of attribute tab.
65 66 67 |
# File 'lib/radiant/admin_ui.rb', line 65 def tab @tab end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
64 65 66 |
# File 'lib/radiant/admin_ui.rb', line 64 def url @url end |
Instance Method Details
#relative_url ⇒ Object
75 76 77 |
# File 'lib/radiant/admin_ui.rb', line 75 def relative_url File.join(ActionController::Base.relative_url_root || '', url) end |
#visible?(user) ⇒ Boolean
71 72 73 |
# File 'lib/radiant/admin_ui.rb', line 71 def visible?(user) tab.visible?(user) && visible_by_controller?(user) end |