Class: TermUtils::FF::FinderEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/term_utils/ff/finder.rb

Overview

Represents filesystem Entry.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFinderEntry



50
51
52
53
54
55
56
# File 'lib/term_utils/ff/finder.rb', line 50

def initialize
  @index = nil
  @name = nil
  @kind = nil
  @path_parts = nil
  @path = nil
end

Instance Attribute Details

#gidInteger

Returns the numeric group id of the owner of stat.



37
38
39
# File 'lib/term_utils/ff/finder.rb', line 37

def gid
  @gid
end

#indexInteger



24
25
26
# File 'lib/term_utils/ff/finder.rb', line 24

def index
  @index
end

#kindString

Identifies the type of stat. The return string is one of: “file”, “directory”, “characterSpecial”, “blockSpecial”, “fifo”, “link”, “socket”, or “unknown”.



31
32
33
# File 'lib/term_utils/ff/finder.rb', line 31

def kind
  @kind
end

#modeInteger

Returns an integer representing the permission bits of stat. The meaning of the bits is platform dependent.



41
42
43
# File 'lib/term_utils/ff/finder.rb', line 41

def mode
  @mode
end

#nameString



26
27
28
# File 'lib/term_utils/ff/finder.rb', line 26

def name
  @name
end

#pathString



48
49
50
# File 'lib/term_utils/ff/finder.rb', line 48

def path
  @path
end

#path_partsArray<String>



46
47
48
# File 'lib/term_utils/ff/finder.rb', line 46

def path_parts
  @path_parts
end

#sizeInteger

Returns the size of stat in bytes.



44
45
46
# File 'lib/term_utils/ff/finder.rb', line 44

def size
  @size
end

#uidInteger

Returns the numeric user id of the owner of stat.



34
35
36
# File 'lib/term_utils/ff/finder.rb', line 34

def uid
  @uid
end

Instance Method Details

#depthInteger



67
68
69
# File 'lib/term_utils/ff/finder.rb', line 67

def depth
  @path_parts.length
end

#directory?Boolean



58
59
60
# File 'lib/term_utils/ff/finder.rb', line 58

def directory?
  @kind == 'directory'
end

#file?Boolean



62
63
64
# File 'lib/term_utils/ff/finder.rb', line 62

def file?
  @kind == 'file'
end