Module: Store::Digest::Meta

Included in:
LMDB
Defined in:
lib/store/digest/meta.rb

Overview

This is an abstract module for metadata operations. All required methods are defined, and raise NotImplementedError.

Defined Under Namespace

Modules: LMDB Classes: CorruptStateError

Instance Method Summary collapse

Instance Method Details

#algorithmsArray

Return the set of algorithms initialized in the database.

Returns:

  • (Array)

    the algorithms

Raises:

  • (NotImplementedError)


112
113
114
# File 'lib/store/digest/meta.rb', line 112

def algorithms
  raise NotImplementedError
end

#bytesInteger

Return the number of bytes stored in the database (notwithstanding the database itself).

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


146
147
148
# File 'lib/store/digest/meta.rb', line 146

def bytes
  raise NotImplementedError
end

#deletedInteger

Return the number of objects whose payloads are deleted but are still on record.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


137
138
139
# File 'lib/store/digest/meta.rb', line 137

def deleted
  raise NotImplementedError
end

#list(type: nil, charset: nil, encoding: nil, language: nil, size: nil, ctime: nil, mtime: nil, ptime: nil, dtime: nil, sort: nil) ⇒ Array

Return a list of objects matching the given criteria. The result set will be the intersection of all supplied parameters. ‘:type`, `:charset`, `:encoding`, and `:language` are treated like discrete sets, while the rest of the parameters are treated like ranges (two-element arrays). Single values will be coerced into arrays; single range values will be interpreted as an inclusive lower bound. To bound only at the top, use a two-element array with its first value `nil`, like so: `size: [nil, 31337]`. The sorting criteria are the symbols of the other parameters.

Parameters:

  • type (nil, String, #to_a) (defaults to: nil)
  • charset (nil, String, #to_a) (defaults to: nil)
  • encoding (nil, String, #to_a) (defaults to: nil)
  • language (nil, String, #to_a) (defaults to: nil)
  • size (nil, Integer, #to_a) (defaults to: nil)

    byte size range

  • ctime (nil, Time, DateTime, #to_a) (defaults to: nil)

    creation time range

  • mtime (nil, Time, DateTime, #to_a) (defaults to: nil)

    modification time range

  • ptime (nil, Time, DateTime, #to_a) (defaults to: nil)

    medatata property change range

  • dtime (nil, Time, DateTime, #to_a) (defaults to: nil)

    deletion time range

  • sort (nil, Symbol, #to_a) (defaults to: nil)

    sorting criteria

Returns:

  • (Array)

    the list

Raises:

  • (NotImplementedError)


173
174
175
176
# File 'lib/store/digest/meta.rb', line 173

def list type: nil, charset: nil, encoding: nil, language: nil,
    size: nil, ctime: nil, mtime: nil, ptime: nil, dtime: nil, sort: nil
  raise NotImplementedError
end

#objectsInteger

Return the number of objects in the database.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


128
129
130
# File 'lib/store/digest/meta.rb', line 128

def objects
  raise NotImplementedError
end

#primarySymbol

Return the primary digest algorithm.

Returns:

  • (Symbol)

    the primary algorithm

Raises:

  • (NotImplementedError)


120
121
122
# File 'lib/store/digest/meta.rb', line 120

def primary
  raise NotImplementedError
end

#transaction(&block) ⇒ Object

Wrap the block in a transaction.

Parameters:

  • block (Proc)

    whatever you pass into the transaction.

Returns:

  • (Object)

    whatever the block returns.

Raises:

  • (NotImplementedError)


104
105
106
# File 'lib/store/digest/meta.rb', line 104

def transaction &block
  raise NotImplementedError
end