Class: NavigationPane
- Inherits:
-
Object
- Object
- NavigationPane
- Defined in:
- lib/almirah/navigation_pane.rb
Instance Attribute Summary collapse
-
#specifications ⇒ Object
Returns the value of attribute specifications.
Instance Method Summary collapse
-
#initialize(specifications) ⇒ NavigationPane
constructor
A new instance of NavigationPane.
- #to_html ⇒ Object
Constructor Details
#initialize(specifications) ⇒ NavigationPane
Returns a new instance of NavigationPane.
6 7 8 |
# File 'lib/almirah/navigation_pane.rb', line 6 def initialize(specifications) @specifications = specifications end |
Instance Attribute Details
#specifications ⇒ Object
Returns the value of attribute specifications.
4 5 6 |
# File 'lib/almirah/navigation_pane.rb', line 4 def specifications @specifications end |
Instance Method Details
#to_html ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/almirah/navigation_pane.rb', line 10 def to_html s = "<ul class=\"fa-ul\">\n" @specifications.each do |spec| s += "\t<li><span class=\"fa-li\"><i class=\"fa fa-folder-open-o\"> </i></span> #{spec.id}\n" s += "\t\t<ul class=\"fa-ul\">\n" s += "\t\t\t<li><span class=\"fa-li\"><i class=\"fa fa-plus-square-o\"> </i></span>\n" s += "\t\t\t\t<a href=\".\\..\\#{spec.id }\\#{spec.id }.html\">#{spec.title}</a>\n" s += "\t\t\t</li>\n" s += "\t\t</ul>\n" s += "\t</li>\n" end s += "</ul>\n" end |