C:\cpanrun\depot\main\contrib-patched\perl\CPAN\src\Data-Hive\blib/lib/Data/Hive/Store.pm


NAME

Data::Hive::Store


DESCRIPTION

Data::Hive::Store is a generic interface to a backend store for Data::Hive.


METHODS

All methods are passed at least a 'path' (arrayref of namespace pieces). Joining the path in a way that is meaningful is most of the point of the Store modules.

get

  print $store->get(\@path, \%opt);

Return the resource represented by the given path, however $store is structured. This could map to e.g.

  $hash->{foo}->{bar}
  $obj->get('foo.bar')
  io('/foo/bar')->all

depending on the Store module involved.

set

  $store->set(\@path, $value, \%opt);

Analogous to get.

name

  print $store->name(\@path, \%opt);

Return a store-specific name for the given path. This is primarily useful for stores that may be accessed independently of the hive; in the io example above, some external process/function may want to write to < /foo/bar > directly.

exists

  if ($store->exists(\@path, \%opt)) { ... }

Returns true if the given path exists in the store.

delete

  $store->delete(\@path, \%opt);

Delete the given path from the store. Return the previous value, if any.