Class: Escort::Setup::Configuration::Locator::SpecifiedDirectory
- Defined in:
- lib/escort/setup/configuration/locator/specified_directory.rb
Instance Attribute Summary collapse
-
#location_directory ⇒ Object
readonly
Returns the value of attribute location_directory.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(filename, location_directory) ⇒ SpecifiedDirectory
constructor
A new instance of SpecifiedDirectory.
- #locate ⇒ Object
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_directory ⇒ Object (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
#locate ⇒ Object
13 14 15 16 |
# File 'lib/escort/setup/configuration/locator/specified_directory.rb', line 13 def locate filepath = File.(File.join(location_directory, filename)) File.exists?(filepath) ? filepath : nil end |