Class: GuideEmUp::Guide
- Inherits:
-
Struct
- Object
- Struct
- GuideEmUp::Guide
- Defined in:
- lib/guide-em-up/guide.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#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 17 |
# File 'lib/guide-em-up/guide.rb', line 10 def initialize(filename, template) @codemap = {} self.filename = filename self.directory = File.dirname(filename) self.title = File.basename(filename) self.template = template self.content = get_content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content
9 10 11 |
# File 'lib/guide-em-up/guide.rb', line 9 def content @content end |
#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
19 20 21 22 |
# File 'lib/guide-em-up/guide.rb', line 19 def html tmpl = File.read(template) Erubis::Eruby.new(tmpl).result(to_hash) end |