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
Trueif this is a directory. -
#etag ⇒ String?
ETag of this entry.
-
#file? ⇒ Boolean
Returns
Trueif 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
60 61 62 |
# File 'src/metadata.rs', line 60
pub fn content_disposition(&self) -> Option<&str> {
self.0.content_disposition()
}
|
#content_length ⇒ Integer
Content length of this entry.
68 69 70 |
# File 'src/metadata.rs', line 68
pub fn content_length(&self) -> u64 {
self.0.content_length()
}
|
#content_md5 ⇒ String?
Content MD5 of this entry.
76 77 78 |
# File 'src/metadata.rs', line 76
pub fn content_md5(&self) -> Option<&str> {
self.0.content_md5()
}
|
#content_type ⇒ String?
Content Type of this entry.
84 85 86 |
# File 'src/metadata.rs', line 84
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.
92 93 94 95 |
# File 'src/metadata.rs', line 92
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.
48 49 50 51 52 53 54 |
# File 'src/metadata.rs', line 48
pub fn mode(&self) -> &str {
match self.0.mode() {
ocore::EntryMode::FILE => "File",
ocore::EntryMode::DIR => "Directory",
ocore::EntryMode::Unknown => "Unknown",
}
}
|