Sha256: 79da43ada71e3a9ba30c3f4b2d5465a42619550212c7007f9b362eeba1ba73ac
Contents?: true
Size: 981 Bytes
Versions: 1
Compression:
Stored size: 981 Bytes
Contents
require "pathname" require_relative "./filetree/simple_tree" class Pathname alias :_parent :parent alias :_children :children end class FileTree < Pathname include SimpleTree VERSION = "1.0.0" attr_accessor :name, :id, :identifier def name @name ||= self.inspect end def id @id ||= self.inspect end def identifier @identifier ||= self.inspect end # # See {http://rubydoc.info/stdlib/pathname/Pathname:parent Pathname.parent} # # @return [FileTree] The directory immediately above self. # def parent FileTree.new(_parent) end # # See {http://rubydoc.info/stdlib/pathname/Pathname:children Pathname.children} # # @return [Array] an Array of all entries contained in self. # def children(*args) if self.directory? _children(*args) else [] end end # # Joins the given pathnames onto self to create a new FileTree object. def join(*args) FileTree.new(super(*args)) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
filetree-1.0.0 | lib/filetree.rb |