Class: Escort::Setup::Configuration::Locator::Chaining
- Defined in:
- lib/escort/setup/configuration/locator/chaining.rb
Instance Attribute Summary collapse
-
#locators ⇒ Object
readonly
Returns the value of attribute locators.
Attributes inherited from Base
Instance Method Summary collapse
- #add_locator(locator) ⇒ Object
-
#initialize(filename, locators = []) ⇒ Chaining
constructor
A new instance of Chaining.
- #locate ⇒ Object
Constructor Details
#initialize(filename, locators = []) ⇒ Chaining
Returns a new instance of Chaining.
8 9 10 11 |
# File 'lib/escort/setup/configuration/locator/chaining.rb', line 8 def initialize(filename, locators = []) super(filename) @locators = locators || [] end |
Instance Attribute Details
#locators ⇒ Object (readonly)
Returns the value of attribute locators.
6 7 8 |
# File 'lib/escort/setup/configuration/locator/chaining.rb', line 6 def locators @locators end |
Instance Method Details
#add_locator(locator) ⇒ Object
21 22 23 24 |
# File 'lib/escort/setup/configuration/locator/chaining.rb', line 21 def add_locator(locator) @locators << locator self end |
#locate ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/escort/setup/configuration/locator/chaining.rb', line 13 def locate locators.each do |locator| filepath = locator.locate return filepath if filepath end nil end |