Class: Alx::Editor

Inherits:
Object
  • Object
show all
Includes:
Executer
Defined in:
lib/alx/editor.rb

Instance Method Summary collapse

Methods included from Executer

#start

Constructor Details

#initialize(conf) ⇒ Editor

Returns a new instance of Editor.



8
9
10
# File 'lib/alx/editor.rb', line 8

def initialize( conf )
  @conf = conf
end

Instance Method Details

#edit(file_name) ⇒ Object



12
13
14
15
# File 'lib/alx/editor.rb', line 12

def edit( file_name )
  @editor_command = @conf[ :editor ]
  @editor_command ? use_editor( file_name ) : use_stdin( file_name )
end