Class: SwedbankPay::SidebarPath
- Inherits:
-
Object
- Object
- SwedbankPay::SidebarPath
- Defined in:
- lib/sidebar_path.rb
Overview
Represents a page in the Sidebar
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(path) ⇒ SidebarPath
constructor
A new instance of SidebarPath.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path) ⇒ SidebarPath
Returns a new instance of SidebarPath.
11 12 13 14 15 16 |
# File 'lib/sidebar_path.rb', line 11 def initialize(path) @segments = segment(path) @path = normalized(path) @name = construct_name @parent = find_parent end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
9 10 11 |
# File 'lib/sidebar_path.rb', line 9 def level @level end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/sidebar_path.rb', line 9 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
9 10 11 |
# File 'lib/sidebar_path.rb', line 9 def parent @parent end |
Instance Method Details
#inspect ⇒ Object
22 23 24 |
# File 'lib/sidebar_path.rb', line 22 def inspect to_s end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/sidebar_path.rb', line 18 def to_s @path end |