Class: Gribr::Executable
- Inherits:
-
Object
- Object
- Gribr::Executable
- Defined in:
- lib/gribr/executeable.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(name) ⇒ Executable
constructor
A new instance of Executable.
- #path ⇒ Object
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
#name ⇒ Object (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
11 12 13 |
# File 'lib/gribr/executeable.rb', line 11 def exist? File.exist?(path) end |
#path ⇒ Object
15 16 17 |
# File 'lib/gribr/executeable.rb', line 15 def path @path ||= candidates.find { |candidate| File.exists?(candidate) } end |