Class: Til::NoteEditor

Inherits:
Object
  • Object
show all
Defined in:
lib/til/services/note_editor.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(note) ⇒ NoteEditor

Returns a new instance of NoteEditor.



5
6
7
# File 'lib/til/services/note_editor.rb', line 5

def initialize(note)
  @path = note.path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/til/services/note_editor.rb', line 3

def path
  @path
end

Class Method Details

.open(note) ⇒ Object



9
10
11
# File 'lib/til/services/note_editor.rb', line 9

def self.open(note)
  self.new(note)
end

Instance Method Details

#editObject



13
14
15
# File 'lib/til/services/note_editor.rb', line 13

def edit
  system(EDITOR, path)
end