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.
272 273 274 275 276 277 |
# File 'lib/rubypath/backend/mock.rb', line 272 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.
270 271 272 |
# File 'lib/rubypath/backend/mock.rb', line 270 def atime @atime end |
#mode ⇒ Object
Returns the value of attribute mode.
270 271 272 |
# File 'lib/rubypath/backend/mock.rb', line 270 def mode @mode end |
#mtime ⇒ Object
Returns the value of attribute mtime.
270 271 272 |
# File 'lib/rubypath/backend/mock.rb', line 270 def mtime @mtime end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
269 270 271 |
# File 'lib/rubypath/backend/mock.rb', line 269 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
269 270 271 |
# File 'lib/rubypath/backend/mock.rb', line 269 def parent @parent end |
#sys ⇒ Object (readonly)
Returns the value of attribute sys.
269 270 271 |
# File 'lib/rubypath/backend/mock.rb', line 269 def sys @sys end |
Instance Method Details
#added(parent) ⇒ Object
292 293 294 |
# File 'lib/rubypath/backend/mock.rb', line 292 def added(parent) @parent = parent end |
#lookup(_path) ⇒ Object
288 289 290 |
# File 'lib/rubypath/backend/mock.rb', line 288 def lookup(_path) raise NotImplementError.new 'Subclass responsibility.' end |
#path ⇒ Object
296 297 298 |
# File 'lib/rubypath/backend/mock.rb', line 296 def path parent ? "#{parent.path}/#{name}" : name end |