Class: GuideEmUp::Guide
- Inherits:
-
Struct
- Object
- Struct
- GuideEmUp::Guide
- Defined in:
- lib/guide-em-up/guide.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#template ⇒ Object
Returns the value of attribute template.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(filename, template) ⇒ Guide
constructor
A new instance of Guide.
Constructor Details
#initialize(filename, template) ⇒ Guide
Returns a new instance of Guide.
10 11 12 13 14 15 16 |
# File 'lib/guide-em-up/guide.rb', line 10 def initialize(filename, template) self.filename = filename self.directory = File.dirname(filename) self.title = File.basename(filename) self.template = template @codemap = {} end |
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory
9 10 11 |
# File 'lib/guide-em-up/guide.rb', line 9 def directory @directory end |
#filename ⇒ Object
Returns the value of attribute filename
9 10 11 |
# File 'lib/guide-em-up/guide.rb', line 9 def filename @filename end |
#template ⇒ Object
Returns the value of attribute template
9 10 11 |
# File 'lib/guide-em-up/guide.rb', line 9 def template @template end |
#title ⇒ Object
Returns the value of attribute title
9 10 11 |
# File 'lib/guide-em-up/guide.rb', line 9 def title @title end |
Instance Method Details
#html ⇒ Object
18 19 20 21 |
# File 'lib/guide-em-up/guide.rb', line 18 def html tmpl = File.read(template) Erubis::Eruby.new(tmpl).result(to_hash) end |