Class: Escort::Setup::Configuration::Locator::SpecifiedDirectory

Inherits:
Base
  • Object
show all
Defined in:
lib/escort/setup/configuration/locator/specified_directory.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#filename

Instance Method Summary collapse

Constructor Details

#initialize(filename, location_directory) ⇒ SpecifiedDirectory

Returns a new instance of SpecifiedDirectory


8
9
10
11
# File 'lib/escort/setup/configuration/locator/specified_directory.rb', line 8

def initialize(filename, location_directory)
  super(filename)
  @location_directory = location_directory
end

Instance Attribute Details

#location_directoryObject (readonly)

Returns the value of attribute location_directory


6
7
8
# File 'lib/escort/setup/configuration/locator/specified_directory.rb', line 6

def location_directory
  @location_directory
end

Instance Method Details

#locateObject


13
14
15
16
# File 'lib/escort/setup/configuration/locator/specified_directory.rb', line 13

def locate
  filepath = File.expand_path(File.join(location_directory, filename))
  File.exists?(filepath) ? filepath : nil
end