Class: Gribr::Executable

Inherits:
Object
  • Object
show all
Defined in:
lib/gribr/executeable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Executable

Returns a new instance of Executable.



7
8
9
# File 'lib/gribr/executeable.rb', line 7

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/gribr/executeable.rb', line 5

def name
  @name
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/gribr/executeable.rb', line 11

def exist?
  File.exist?(path)
end

#pathObject



15
16
17
# File 'lib/gribr/executeable.rb', line 15

def path
  @path ||= candidates.find { |candidate| File.exists?(candidate) }
end