Class: MemFs::Fake::File
- Defined in:
- lib/memfs/fake/file.rb,
lib/memfs/fake/file/content.rb
Defined Under Namespace
Classes: Content
Constant Summary
Constants inherited from Entry
Entry::GEXEC, Entry::GREAD, Entry::GWRITE, Entry::OEXEC, Entry::OREAD, Entry::OWRITE, Entry::RSTICK, Entry::SETGID, Entry::SETUID, Entry::UEXEC, Entry::UREAD, Entry::USTICK, Entry::UWRITE
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
Attributes inherited from Entry
#atime, #block_device, #character_device, #ctime, #gid, #mode, #mtime, #name, #parent, #uid
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
-
#initialize(*args) ⇒ File
constructor
A new instance of File.
- #pos ⇒ Object
- #pos=(value) ⇒ Object
- #size ⇒ Object
- #type ⇒ Object
Methods inherited from Entry
#blksize, #delete, #dereferenced, #dereferenced_name, #dereferenced_path, #dev, #find, #ino, #path, #touch
Constructor Details
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
7 8 9 |
# File 'lib/memfs/fake/file.rb', line 7 def content @content end |
Instance Method Details
#close ⇒ Object
9 10 11 |
# File 'lib/memfs/fake/file.rb', line 9 def close @closed = true end |
#closed? ⇒ Boolean
13 14 15 |
# File 'lib/memfs/fake/file.rb', line 13 def closed? @closed end |
#pos ⇒ Object
23 24 25 |
# File 'lib/memfs/fake/file.rb', line 23 def pos content.pos end |
#pos=(value) ⇒ Object
27 28 29 |
# File 'lib/memfs/fake/file.rb', line 27 def pos=(value) content.pos = value end |
#size ⇒ Object
31 32 33 |
# File 'lib/memfs/fake/file.rb', line 31 def size content.size end |
#type ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/memfs/fake/file.rb', line 35 def type case when block_device then 'blockSpecial' when character_device then 'characterSpecial' else 'file' end end |