Class: Chitin::FSObject

Inherits:
Object show all
Defined in:
lib/chitin/file.rb

Direct Known Subclasses

Directory, FileObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, opts = {}) ⇒ FSObject

The choice to not have File.expand_path here is explicitly done. Relativity is up to the user. Also it got really annoying seeing the same prefix over and over and over again on lists of files.



9
10
11
12
# File 'lib/chitin/file.rb', line 9

def initialize(path, opts={})
  @path = path
  @unknown = opts[:unknown]
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/chitin/file.rb', line 3

def path
  @path
end

Instance Method Details

#lstatObject



18
19
20
# File 'lib/chitin/file.rb', line 18

def lstat
  File.lstat @path
end

#to_sObject



22
23
24
# File 'lib/chitin/file.rb', line 22

def to_s
  path
end

#unknown_type?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/chitin/file.rb', line 14

def unknown_type?
  @unknown
end