Class: Executable

Inherits:
Object
  • Object
show all
Defined in:
lib/devlogs/executable.rb

Direct Known Subclasses

Editor, Pager

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExecutable

Returns a new instance of Executable.

Raises:

  • (NotImplementedError)


4
5
6
# File 'lib/devlogs/executable.rb', line 4

def initialize
  raise NotImplementedError, "Abstract class"
end

Class Method Details

.open(path) ⇒ Object

Opens the file at path using system editor



17
18
19
20
21
# File 'lib/devlogs/executable.rb', line 17

def open(path)
  session = new

  session.open(path)
end

Instance Method Details

#open(path) ⇒ Object

Opens the file contained at the path



9
10
11
12
13
# File 'lib/devlogs/executable.rb', line 9

def open(path)
  command = "#{@program} #{path}"

  system command
end