Class: Vita::Note
- Inherits:
-
Object
- Object
- Vita::Note
- Defined in:
- lib/vita/note.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(filename) ⇒ Note
constructor
A new instance of Note.
- #title ⇒ Object
Constructor Details
#initialize(filename) ⇒ Note
Returns a new instance of Note.
5 6 7 |
# File 'lib/vita/note.rb', line 5 def initialize(filename) @filename = filename end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/vita/note.rb', line 3 def filename @filename end |
Instance Method Details
#content ⇒ Object
13 14 15 |
# File 'lib/vita/note.rb', line 13 def content @content ||= File.read(@filename) end |
#title ⇒ Object
9 10 11 |
# File 'lib/vita/note.rb', line 9 def title File.basename(@filename, File.extname(@filename)) end |