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, #birthtime, #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, #fileno, #find, #ino, #path, #paths, #touch
Constructor Details
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
9 10 11 |
# File 'lib/memfs/fake/file.rb', line 9 def content @content end |
Instance Method Details
#close ⇒ Object
11 12 13 |
# File 'lib/memfs/fake/file.rb', line 11 def close @closed = true end |
#closed? ⇒ Boolean
15 16 17 |
# File 'lib/memfs/fake/file.rb', line 15 def closed? @closed end |
#pos ⇒ Object
25 26 27 |
# File 'lib/memfs/fake/file.rb', line 25 def pos content.pos end |
#pos=(value) ⇒ Object
29 30 31 |
# File 'lib/memfs/fake/file.rb', line 29 def pos=(value) content.pos = value end |
#size ⇒ Object
33 34 35 |
# File 'lib/memfs/fake/file.rb', line 33 def size content.size end |
#type ⇒ Object
37 38 39 40 41 42 |
# File 'lib/memfs/fake/file.rb', line 37 def type return 'blockSpecial' if block_device return 'characterSpecial' if character_device 'file' end |