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.
-
#ctime ⇒ Object
readonly
Returns the value of attribute ctime.
-
#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 |
#ctime ⇒ Object (readonly)
Returns the value of attribute ctime.
4 5 6 |
# File 'lib/fakefs/fake/file.rb', line 4 def ctime @ctime end |
#inode ⇒ Object
Returns the value of attribute inode.
39 40 41 |
# File 'lib/fakefs/fake/file.rb', line 39 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
57 58 59 60 61 62 |
# File 'lib/fakefs/fake/file.rb', line 57 def clone(parent = nil) clone = super() clone.parent = parent if parent clone.inode = inode.clone clone end |
#delete ⇒ Object
76 77 78 79 |
# File 'lib/fakefs/fake/file.rb', line 76 def delete inode.unlink(self) parent.delete(self) end |
#entry ⇒ Object
64 65 66 |
# File 'lib/fakefs/fake/file.rb', line 64 def entry self end |
#inspect ⇒ Object
68 69 70 |
# File 'lib/fakefs/fake/file.rb', line 68 def inspect "(FakeFile name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{content.size})" end |
#link(other_file) ⇒ Object
53 54 55 |
# File 'lib/fakefs/fake/file.rb', line 53 def link(other_file) @inode.link(other_file) end |
#links ⇒ Object
49 50 51 |
# File 'lib/fakefs/fake/file.rb', line 49 def links @inode.links end |