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

Returns a new instance of FinderEntry.



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.

Returns:

  • (Integer)


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

def gid
  @gid
end

#indexInteger

Returns:

  • (Integer)


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”.

Returns:

  • (String)


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.

Returns:

  • (Integer)


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

def mode
  @mode
end

#nameString

Returns:

  • (String)


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

def name
  @name
end

#pathString

Returns:

  • (String)


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

def path
  @path
end

#path_partsArray<String>

Returns:

  • (Array<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.

Returns:

  • (Integer)


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.

Returns:

  • (Integer)


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

def uid
  @uid
end

Instance Method Details

#depthInteger

Returns:

  • (Integer)


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

def depth
  @path_parts.length
end

#directory?Boolean

Returns:

  • (Boolean)


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

def directory?
  @kind == 'directory'
end

#file?Boolean

Returns:

  • (Boolean)


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

def file?
  @kind == 'file'
end