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 10 11 |
# File 'lib/bfs.rb', line 6 def initialize(**attrs) super(nil) update(size: 0, mtime: Time.at(0), mode: 0, metadata: {}) update(attrs) end |
Instance Method Details
#content_type ⇒ Object
21 22 23 |
# File 'lib/bfs.rb', line 21 def content_type fetch(:content_type, nil) end |
#metadata ⇒ Object
33 34 35 |
# File 'lib/bfs.rb', line 33 def fetch(:metadata, {}) end |
#mode ⇒ Object
29 30 31 |
# File 'lib/bfs.rb', line 29 def mode fetch(:mode, 0) end |
#mtime ⇒ Object
25 26 27 |
# File 'lib/bfs.rb', line 25 def mtime fetch(:mtime, Time.at(0)) end |
#path ⇒ Object
13 14 15 |
# File 'lib/bfs.rb', line 13 def path fetch(:path, nil) end |
#size ⇒ Object
17 18 19 |
# File 'lib/bfs.rb', line 17 def size fetch(:size, 0) end |