Class: Path::Backend::Mock::Node
- Inherits:
-
Object
- Object
- Path::Backend::Mock::Node
- Defined in:
- lib/rubypath/backend/mock.rb
Internal Virtual File System collapse
-
#atime ⇒ Object
Returns the value of attribute atime.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#mtime ⇒ Object
Returns the value of attribute mtime.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#sys ⇒ Object
readonly
Returns the value of attribute sys.
Internal Virtual File System collapse
- #added(parent) ⇒ Object
-
#initialize(backend, name, ops = {}) ⇒ Node
constructor
A new instance of Node.
- #lookup(path) ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(backend, name, ops = {}) ⇒ Node
Returns a new instance of Node.
266 267 268 269 270 271 |
# File 'lib/rubypath/backend/mock.rb', line 266 def initialize(backend, name, ops = {}) @sys = backend @name = name @mtime = Time.now @atime = Time.now end |
Instance Attribute Details
#atime ⇒ Object
Returns the value of attribute atime.
264 265 266 |
# File 'lib/rubypath/backend/mock.rb', line 264 def atime @atime end |
#mode ⇒ Object
Returns the value of attribute mode.
264 265 266 |
# File 'lib/rubypath/backend/mock.rb', line 264 def mode @mode end |
#mtime ⇒ Object
Returns the value of attribute mtime.
264 265 266 |
# File 'lib/rubypath/backend/mock.rb', line 264 def mtime @mtime end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
263 264 265 |
# File 'lib/rubypath/backend/mock.rb', line 263 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
263 264 265 |
# File 'lib/rubypath/backend/mock.rb', line 263 def parent @parent end |
#sys ⇒ Object (readonly)
Returns the value of attribute sys.
263 264 265 |
# File 'lib/rubypath/backend/mock.rb', line 263 def sys @sys end |
Instance Method Details
#added(parent) ⇒ Object
285 286 287 |
# File 'lib/rubypath/backend/mock.rb', line 285 def added(parent) @parent = parent end |
#lookup(path) ⇒ Object
281 282 283 |
# File 'lib/rubypath/backend/mock.rb', line 281 def lookup(path) raise NotImplementError.new 'Subclass responsibility.' end |
#path ⇒ Object
289 290 291 |
# File 'lib/rubypath/backend/mock.rb', line 289 def path parent ? "#{parent.path}/#{name}" : name end |