Class: Til::NoteWriter
- Inherits:
-
Object
- Object
- Til::NoteWriter
- Defined in:
- lib/til/note_writer.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #call(if_modified, if_unmodified) ⇒ Object
-
#initialize(title) ⇒ NoteWriter
constructor
A new instance of NoteWriter.
Constructor Details
#initialize(title) ⇒ NoteWriter
Returns a new instance of NoteWriter.
5 6 7 |
# File 'lib/til/note_writer.rb', line 5 def initialize title @title = title end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/til/note_writer.rb', line 3 def title @title end |
Instance Method Details
#call(if_modified, if_unmodified) ⇒ Object
9 10 11 12 13 |
# File 'lib/til/note_writer.rb', line 9 def call(if_modified, if_unmodified) temporary_note = TemporaryNote.new temporary_note.write("# #{title}\n\n") temporary_note.edit(if_modified, if_unmodified) end |