Class: Cheepub::Nav
- Inherits:
-
Object
- Object
- Cheepub::Nav
- Defined in:
- lib/cheepub/nav.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#initialize(content) ⇒ Nav
constructor
A new instance of Nav.
- #to_html ⇒ Object
Constructor Details
#initialize(content) ⇒ Nav
Returns a new instance of Nav.
8 9 10 11 12 |
# File 'lib/cheepub/nav.rb', line 8 def initialize(content) @content = content @root = @body = nil parse end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
6 7 8 |
# File 'lib/cheepub/nav.rb', line 6 def root @root end |
Instance Method Details
#to_html ⇒ Object
14 15 16 17 18 19 |
# File 'lib/cheepub/nav.rb', line 14 def to_html template = File.read(File.join(Cheepub::TEMPLATES_DIR, "nav.xhtml.erb")) @body = @root.to_html_ol erb = ERB.new(template) return erb.result(binding) end |