Class: Gollum::File
- Inherits:
-
Object
- Object
- Gollum::File
- Defined in:
- lib/smeagol/gollum/file.rb
Instance Attribute Summary collapse
-
#version ⇒ Object
The current version of the page.
-
#wiki ⇒ Object
readonly
Returns the value of attribute wiki.
Instance Method Summary collapse
- #extname ⇒ Object
-
#populate(blob, path = nil) ⇒ Object
Populate the Page with information from the Blob.
-
#title ⇒ Object
The title will be constructed from the filename by stripping the extension and replacing any dashes with spaces.
Instance Attribute Details
#version ⇒ Object
The current version of the page.
24 25 26 |
# File 'lib/smeagol/gollum/file.rb', line 24 def version @version end |
#wiki ⇒ Object (readonly)
Returns the value of attribute wiki.
19 20 21 |
# File 'lib/smeagol/gollum/file.rb', line 19 def wiki @wiki end |
Instance Method Details
#extname ⇒ Object
39 40 41 |
# File 'lib/smeagol/gollum/file.rb', line 39 def extname ::File.extname(path) end |
#populate(blob, path = nil) ⇒ Object
Populate the Page with information from the Blob.
12 13 14 15 16 |
# File 'lib/smeagol/gollum/file.rb', line 12 def populate(blob, path=nil) @blob = blob @path = "#{path}/#{blob.name}"[1..-1] self end |
#title ⇒ Object
The title will be constructed from the filename by stripping the extension and replacing any dashes with spaces.
34 35 36 |
# File 'lib/smeagol/gollum/file.rb', line 34 def title Sanitize.clean(name).strip end |