Class: CipherStash::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/cipherstash/record.rb

Overview

The fundamental unit of storage.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#uuidString (readonly)

The UUID of the record.

Returns:

  • (String)

    a human-readable formatted UUID.



7
8
9
# File 'lib/cipherstash/record.rb', line 7

def uuid
  @uuid
end

Instance Method Details

#[](k) ⇒ Object, NilClass

Fetch the value of a top-level key in a record.

Parameters:

  • k (String)

    the key to lookup.

Returns:

  • (Object, NilClass)

Raises:



25
26
27
28
29
30
31
# File 'lib/cipherstash/record.rb', line 25

def [](k)
  if @data.nil?
    raise Client::Error::IndexOnlyRecordError, "This record does not have any associated data"
  end

  @data[k]
end