Class: OpenDAL::Metadata
- Inherits:
-
Object
- Object
- OpenDAL::Metadata
- Defined in:
- src/metadata.rs,
lib/opendal_ruby/metadata.rb
Overview
Metadata about the file.
Constant Summary collapse
- FILE =
"File"
- DIRECTORY =
"Directory"
Instance Method Summary collapse
-
#content_disposition ⇒ String?
Content-Disposition of this object.
-
#content_length ⇒ Integer
Content length of this entry.
-
#content_md5 ⇒ String?
Content MD5 of this entry.
-
#content_type ⇒ String?
Content Type of this entry.
-
#dir? ⇒ Boolean
Returns
True
if this is a directory. -
#etag ⇒ String?
ETag of this entry.
-
#file? ⇒ Boolean
Returns
True
if this is a file. - #inspect ⇒ Object
-
#mode ⇒ String
The entry mode of this Metadata.
Instance Method Details
#content_disposition ⇒ String?
Content-Disposition of this object
62 63 64 |
# File 'src/metadata.rs', line 62
pub fn content_disposition(&self) -> Option<&str> {
self.0.content_disposition()
}
|
#content_length ⇒ Integer
Content length of this entry.
70 71 72 |
# File 'src/metadata.rs', line 70
pub fn content_length(&self) -> u64 {
self.0.content_length()
}
|
#content_md5 ⇒ String?
Content MD5 of this entry.
78 79 80 |
# File 'src/metadata.rs', line 78
pub fn content_md5(&self) -> Option<&str> {
self.0.content_md5()
}
|
#content_type ⇒ String?
Content Type of this entry.
86 87 88 |
# File 'src/metadata.rs', line 86
pub fn content_type(&self) -> Option<&str> {
self.0.content_type()
}
|
#dir? ⇒ Boolean
Returns True
if this is a directory.
33 34 35 |
# File 'lib/opendal_ruby/metadata.rb', line 33 def dir? mode == DIRECTORY end |
#etag ⇒ String?
ETag of this entry.
94 95 96 97 |
# File 'src/metadata.rs', line 94
pub fn etag(&self) -> Option<&str> {
self.0.etag()
}
}
|
#file? ⇒ Boolean
Returns True
if this is a file.
27 28 29 |
# File 'lib/opendal_ruby/metadata.rb', line 27 def file? mode == FILE end |
#inspect ⇒ Object
37 38 39 40 41 42 |
# File 'lib/opendal_ruby/metadata.rb', line 37 def inspect # Be concise to keep a few attributes "#<#{self.class.name} mode: #{entry_mode}, \ content_type: #{content_type}, \ content_length: #{content_length}>" end |
#mode ⇒ String
The entry mode of this Metadata.
50 51 52 53 54 55 56 |
# File 'src/metadata.rs', line 50
pub fn mode(&self) -> &str {
match self.0.mode() {
ocore::EntryMode::FILE => "File",
ocore::EntryMode::DIR => "Directory",
ocore::EntryMode::Unknown => "Unknown",
}
}
|