Class: Radiant::AdminUI::NavSubItem

Inherits:
Object
  • Object
show all
Defined in:
lib/radiant/admin_ui.rb

Overview

Simple structure for storing the properties of a tab’s sub items.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



82
83
84
# File 'lib/radiant/admin_ui.rb', line 82

def name
  @name
end

#tabObject

Returns the value of attribute tab.



83
84
85
# File 'lib/radiant/admin_ui.rb', line 83

def tab
  @tab
end

#urlObject (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_urlObject



93
94
95
# File 'lib/radiant/admin_ui.rb', line 93

def relative_url
  File.join('', url)
end

#visible?(user) ⇒ Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/radiant/admin_ui.rb', line 89

def visible?(user)
  visible_by_controller?(user)
end