Class: TermUtils::FF::FinderEntry
- Inherits:
-
Object
- Object
- TermUtils::FF::FinderEntry
- Defined in:
- lib/term_utils/ff/finder.rb
Overview
Represents filesystem Entry.
Instance Attribute Summary collapse
-
#gid ⇒ Integer
Returns the numeric group id of the owner of stat.
- #index ⇒ Integer
-
#kind ⇒ String
Identifies the type of stat.
-
#mode ⇒ Integer
Returns an integer representing the permission bits of stat.
- #name ⇒ String
- #path ⇒ String
- #path_parts ⇒ Array<String>
-
#size ⇒ Integer
Returns the size of stat in bytes.
-
#uid ⇒ Integer
Returns the numeric user id of the owner of stat.
Instance Method Summary collapse
- #depth ⇒ Integer
- #directory? ⇒ Boolean
- #file? ⇒ Boolean
-
#initialize ⇒ FinderEntry
constructor
A new instance of FinderEntry.
Constructor Details
#initialize ⇒ FinderEntry
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
#gid ⇒ Integer
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 |
#index ⇒ Integer
24 25 26 |
# File 'lib/term_utils/ff/finder.rb', line 24 def index @index end |
#kind ⇒ String
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 |
#mode ⇒ Integer
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 |
#name ⇒ String
26 27 28 |
# File 'lib/term_utils/ff/finder.rb', line 26 def name @name end |
#path ⇒ String
48 49 50 |
# File 'lib/term_utils/ff/finder.rb', line 48 def path @path end |
#path_parts ⇒ Array<String>
46 47 48 |
# File 'lib/term_utils/ff/finder.rb', line 46 def path_parts @path_parts end |
#size ⇒ Integer
Returns the size of stat in bytes.
44 45 46 |
# File 'lib/term_utils/ff/finder.rb', line 44 def size @size end |
#uid ⇒ Integer
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
#depth ⇒ Integer
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 |