Parent

Files

FakeFS::FakeDir

Attributes

ctime[R]
mtime[R]
name[RW]
parent[RW]

Public Class Methods

new(name = nil, parent = nil) click to toggle source
# File lib/fakefs/fake/dir.rb, line 6
def initialize(name = nil, parent = nil)
  @name   = name
  @parent = parent
  @ctime  = Time.now
  @mtime  = @ctime
end

Public Instance Methods

clone(parent = nil) click to toggle source
# 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
delete(node = self) click to toggle source
# File lib/fakefs/fake/dir.rb, line 40
def delete(node = self)
  if node == self
    parent.delete(self)
  else
    super(node.name)
  end
end
entry() click to toggle source
# File lib/fakefs/fake/dir.rb, line 13
def entry
  self
end
inspect() click to toggle source
# File lib/fakefs/fake/dir.rb, line 17
def inspect
  "(FakeDir name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{size})"
end
to_s() click to toggle source
# 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.