Class: OpenDAL::Entry

Inherits:
Object
  • Object
show all
Defined in:
src/lister.rs,
lib/opendal_ruby/entry.rb

Overview

Entry returned by Lister to represent a path and it's relative metadata.

Instance Method Summary collapse

Instance Method Details

#inspectObject



31
32
33
# File 'lib/opendal_ruby/entry.rb', line 31

def inspect
  "#<#{self.class.name} path: \"#{path}\", metadata: #{.inspect}>"
end

#metadataMetadata

Fetches the metadata of this entry.

Returns:



73
74
75
76
# File 'src/lister.rs', line 73

fn metadata(&self) -> Result<Metadata, Error> {
        Ok(Metadata::new(self.0.metadata().clone()))
    }
}

#nameString

Gets the name of entry. Name is the last segment of path.

If this entry is a dir, name MUST end with / Otherwise, name MUST NOT end with /.

Returns:

  • (String)


65
66
67
# File 'src/lister.rs', line 65

fn name(&self) -> Result<&str, Error> {
    Ok(self.0.name())
}

#pathString

Gets the path of entry. Path is relative to operator's root.

Only valid in current operator.

If this entry is a dir, path MUST end with / Otherwise, path MUST NOT end with /.

Returns:

  • (String)


54
55
56
# File 'src/lister.rs', line 54

fn path(&self) -> Result<&str, Error> {
    Ok(self.0.path())
}

#to_hHash

Returns the canonical data about an entry

Returns:

  • (Hash)


24
25
26
27
28
29
# File 'lib/opendal_ruby/entry.rb', line 24

def to_h
  {
    path: path,
    metadata: 
  }
end