Class: FSSM::Tree::Node
- Inherits:
-
Object
- Object
- FSSM::Tree::Node
- Includes:
- NodeBase, NodeEnumerable
- Defined in:
- lib/fssm/tree.rb
Instance Attribute Summary collapse
-
#ftype ⇒ Object
Returns the value of attribute ftype.
-
#mtime ⇒ Object
Returns the value of attribute mtime.
Instance Method Summary collapse
Methods included from NodeEnumerable
Methods included from NodeBase
Instance Attribute Details
#ftype ⇒ Object
Returns the value of attribute ftype.
122 123 124 |
# File 'lib/fssm/tree.rb', line 122 def ftype @ftype end |
#mtime ⇒ Object
Returns the value of attribute mtime.
121 122 123 |
# File 'lib/fssm/tree.rb', line 121 def mtime @mtime end |
Instance Method Details
#<=>(other) ⇒ Object
124 125 126 127 |
# File 'lib/fssm/tree.rb', line 124 def <=>(other) return unless other.is_a?(::FSSM::Tree::Node) self.mtime <=> other.mtime end |
#from_path(path) ⇒ Object
129 130 131 132 133 134 135 136 |
# File 'lib/fssm/tree.rb', line 129 def from_path(path) path = FSSM::Pathname.for(path) @ftype = path.ftype # this handles bad symlinks without failing. why handle bad symlinks at # all? well, we could still be interested in their creation and deletion. @mtime = path.symlink? ? Time.at(0) : path.mtime self end |