Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/filepath/core_ext/array.rb
Instance Method Summary collapse
-
#as_path ⇒ Filepath
Generates a path using the elements of an array as path segments.
-
#as_path_list ⇒ FilepathList
Generates a path list from an array of paths.
Instance Method Details
#as_path ⇒ Filepath
Note:
FIXME: #as_path should be #to_path but that method name
is already used
Generates a path using the elements of an array as path segments.
[a, b, c].as_path is equivalent to Filepath.join(a, b, c).
24 25 26 |
# File 'lib/filepath/core_ext/array.rb', line 24 def as_path Filepath.join(self) end |
#as_path_list ⇒ FilepathList
Generates a path list from an array of paths.
The elements of the array must respond to #as_path.
ary.as_path is equivalent to FilepathList.new(ary).
42 43 44 |
# File 'lib/filepath/core_ext/array.rb', line 42 def as_path_list FilepathList.new(self) end |