Class: SwedbankPay::SidebarPath

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

Overview

Represents a page in the Sidebar

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#levelObject (readonly)

Returns the value of attribute level.



9
10
11
# File 'lib/sidebar_path.rb', line 9

def level
  @level
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/sidebar_path.rb', line 9

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



9
10
11
# File 'lib/sidebar_path.rb', line 9

def parent
  @parent
end

Instance Method Details

#inspectObject



22
23
24
# File 'lib/sidebar_path.rb', line 22

def inspect
  to_s
end

#to_sObject



18
19
20
# File 'lib/sidebar_path.rb', line 18

def to_s
  @path
end