Module: Lazier::Pathname

Extended by:
ActiveSupport::Concern
Defined in:
lib/lazier/pathname.rb

Overview

Extensions for the Pathname class.

Instance Method Summary (collapse)

Instance Method Details

- (Array) components

Returns all the components that are included in this path.

Pathname.new("/usr/bin/ruby").components
# => ["usr", "bin", "ruby"]

Returns:

  • (Array)

    A list of all components that are included in this path.



20
21
22
23
24
# File 'lib/lazier/pathname.rb', line 20

def components
  rv = []
  self.each_filename { |p| rv << p }
  rv
end