Module: Cowtech::Extensions::Pathname
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/cowtech-extensions/pathname.rb
Overview
Extensions for the Pathname class.
Instance Method Summary collapse
-
#components ⇒ Array
Returns all the components that are included in this path.
Instance Method Details
#components ⇒ Array
Returns all the components that are included in this path.
Pathname.new("/usr/bin/ruby").components
# => ["usr", "bin", "ruby"]
21 22 23 24 25 |
# File 'lib/cowtech-extensions/pathname.rb', line 21 def components rv = [] self.each_filename { |p| rv << p } rv end |