Class: Xebec::NavItem
- Inherits:
-
Object
- Object
- Xebec::NavItem
- Defined in:
- lib/xebec/nav_item.rb
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, href = nil) ⇒ NavItem
constructor
Create a new navigation item.
Constructor Details
#initialize(name, href = nil) ⇒ NavItem
Create a new navigation item.
14 15 16 17 |
# File 'lib/xebec/nav_item.rb', line 14 def initialize(name, href = nil) raise ArgumentError.new("#{name || '<nil>'} is not a valid name for a navigation item") if name.blank? @name, @href = name, href end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
5 6 7 |
# File 'lib/xebec/nav_item.rb', line 5 def href @href end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/xebec/nav_item.rb', line 5 def name @name end |