Class: BFS::FileInfo
- Inherits:
-
Hash
- Object
- Hash
- BFS::FileInfo
- Defined in:
- lib/bfs.rb
Instance Method Summary collapse
- #content_type ⇒ Object
-
#initialize(**attrs) ⇒ FileInfo
constructor
A new instance of FileInfo.
- #metadata ⇒ Object
- #mode ⇒ Object
- #mtime ⇒ Object
- #path ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(**attrs) ⇒ FileInfo
Returns a new instance of FileInfo.
6 7 8 9 |
# File 'lib/bfs.rb', line 6 def initialize(**attrs) update(size: 0, mtime: Time.at(0), mode: 0, metadata: {}) update(attrs) end |
Instance Method Details
#content_type ⇒ Object
19 20 21 |
# File 'lib/bfs.rb', line 19 def content_type fetch(:content_type, nil) end |
#metadata ⇒ Object
31 32 33 |
# File 'lib/bfs.rb', line 31 def fetch(:metadata, {}) end |
#mode ⇒ Object
27 28 29 |
# File 'lib/bfs.rb', line 27 def mode fetch(:mode, 0) end |
#mtime ⇒ Object
23 24 25 |
# File 'lib/bfs.rb', line 23 def mtime fetch(:mtime, Time.at(0)) end |
#path ⇒ Object
11 12 13 |
# File 'lib/bfs.rb', line 11 def path fetch(:path, nil) end |
#size ⇒ Object
15 16 17 |
# File 'lib/bfs.rb', line 15 def size fetch(:size, 0) end |