Class: Pathname
- Inherits:
-
Object
- Object
- Pathname
- Defined in:
- lib/relative/pathname.rb
Instance Method Summary collapse
-
#expand_path_relative_to_caller ⇒ Object
Description: This method returns an absolute expansion of self, relative to the caller’s source file.
Instance Method Details
#expand_path_relative_to_caller ⇒ Object
Description:
This method returns an absolute expansion of self, relative to the caller’s source file. Note that this method is a no-op if self is an absolute Pathname.
Examples:
If the caller’s source file is:
/usr/bin/scripts/print_file.rb
then
relative_path = Pathname.new("config/print_file.cfg")
absolute_path = relative_path.()
will make absolute_path equal to:
Pathname.new("/usr/bin/scripts/config/print_file.cfg")
Parameters:
- file_name
-
A file system path relative to the calling file
Returns:
An absolute expansion of self, relative to the caller’s source file.
28 29 30 |
# File 'lib/relative/pathname.rb', line 28 def return Pathname.new(File.(to_s())) end |