Methods
Attributes
[RW] | name | |
[RW] | parent | |
[R] | ctime | |
[R] | mtime |
Class Public methods
Source: show
# File lib/fakefs/fake/dir.rb, line 6 def initialize(name = nil, parent = nil) @name = name @parent = parent @ctime = Time.now @mtime = @ctime end
Instance Public methods
Source: show
# File lib/fakefs/fake/dir.rb, line 21 def clone(parent = nil) clone = Marshal.load(Marshal.dump(self)) clone.each do |key, value| value.parent = clone end clone.parent = parent if parent clone end
Source: show
# File lib/fakefs/fake/dir.rb, line 40 def delete(node = self) if node == self parent.delete(self) else super(node.name) end end
Source: show
# File lib/fakefs/fake/dir.rb, line 13 def entry self end
Source: show
# File lib/fakefs/fake/dir.rb, line 17 def inspect "(FakeDir name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{size})" end
Source: show
# File lib/fakefs/fake/dir.rb, line 30 def to_s if parent && parent.to_s != '.' File.join(parent.to_s, name) elsif parent && parent.to_s == '.' "#{File::PATH_SEPARATOR}#{name}" else name end end