Class: FakeFS::FakeFile
- Inherits:
-
Object
- Object
- FakeFS::FakeFile
- Defined in:
- lib/fakefs/fake/file.rb
Defined Under Namespace
Classes: Inode
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#inode ⇒ Object
Returns the value of attribute inode.
-
#mtime ⇒ Object
Returns the value of attribute mtime.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #clone(parent = nil) ⇒ Object
- #delete ⇒ Object
- #entry ⇒ Object
-
#initialize(name = nil, parent = nil) ⇒ FakeFile
constructor
A new instance of FakeFile.
- #inspect ⇒ Object
- #link(other_file) ⇒ Object
- #links ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/fakefs/fake/file.rb', line 3 def content @content end |
#inode ⇒ Object
Returns the value of attribute inode.
37 38 39 |
# File 'lib/fakefs/fake/file.rb', line 37 def inode @inode end |
#mtime ⇒ Object
Returns the value of attribute mtime.
3 4 5 |
# File 'lib/fakefs/fake/file.rb', line 3 def mtime @mtime end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/fakefs/fake/file.rb', line 3 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
3 4 5 |
# File 'lib/fakefs/fake/file.rb', line 3 def parent @parent end |
Instance Method Details
#clone(parent = nil) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/fakefs/fake/file.rb', line 55 def clone(parent = nil) clone = super() clone.parent = parent if parent clone.inode = inode.clone clone end |
#delete ⇒ Object
74 75 76 77 |
# File 'lib/fakefs/fake/file.rb', line 74 def delete inode.unlink(self) parent.delete(self) end |
#entry ⇒ Object
62 63 64 |
# File 'lib/fakefs/fake/file.rb', line 62 def entry self end |
#inspect ⇒ Object
66 67 68 |
# File 'lib/fakefs/fake/file.rb', line 66 def inspect "(FakeFile name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{content.size})" end |
#link(other_file) ⇒ Object
51 52 53 |
# File 'lib/fakefs/fake/file.rb', line 51 def link(other_file) @inode.link(other_file) end |
#links ⇒ Object
47 48 49 |
# File 'lib/fakefs/fake/file.rb', line 47 def links @inode.links end |