Class: OpenDal::Metadata
- Inherits:
-
Object
- Object
- OpenDal::Metadata
- Defined in:
- src/metadata.rs,
lib/opendal_ruby/metadata.rb
Overview
Metadata about an object.
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
61 62 63 |
# File 'src/metadata.rs', line 61
pub fn content_disposition(&self) -> Option<&str> {
self.0.content_disposition()
}
|
#content_length ⇒ Integer
Content length of this entry.
69 70 71 |
# File 'src/metadata.rs', line 69
pub fn content_length(&self) -> u64 {
self.0.content_length()
}
|
#content_md5 ⇒ String?
Content MD5 of this entry.
77 78 79 |
# File 'src/metadata.rs', line 77
pub fn content_md5(&self) -> Option<&str> {
self.0.content_md5()
}
|
#content_type ⇒ String?
Content Type of this entry.
85 86 87 |
# File 'src/metadata.rs', line 85
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.
93 94 95 96 |
# File 'src/metadata.rs', line 93
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: #{mode}, \ content_type: #{content_type}, \ content_length: #{content_length}>" end |
#mode ⇒ String
The entry mode of this Metadata.
49 50 51 52 53 54 55 |
# File 'src/metadata.rs', line 49
pub fn mode(&self) -> &str {
match self.0.mode() {
ocore::EntryMode::FILE => "File",
ocore::EntryMode::DIR => "Directory",
ocore::EntryMode::Unknown => "Unknown",
}
}
|