Class: PXCBackup::PathResolver
- Inherits:
-
Object
- Object
- PXCBackup::PathResolver
- Defined in:
- lib/pxcbackup/path_resolver.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PathResolver
constructor
A new instance of PathResolver.
- #method_missing(name, *arguments) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PathResolver
Returns a new instance of PathResolver.
5 6 7 8 |
# File 'lib/pxcbackup/path_resolver.rb', line 5 def initialize( = {}) @options = @paths = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *arguments) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pxcbackup/path_resolver.rb', line 10 def method_missing(name, *arguments) unless @paths[name] @paths[name] = @options["#{name.to_s}_path".to_sym] || `which #{name.to_s.shellescape}`.strip raise "cannot find path for '#{name.to_s}'" unless File.file?(@paths[name]) end @paths[name] end |