Class: E3DB::Meta

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/e3db/client.rb

Overview

Meta-information about an E3DB record, such as who wrote it, when it was written, and the type of data stored.

Instance Attribute Summary collapse

Instance Attribute Details

#createdTime?

Returns when this record was created, or nil if unavailable.

Returns:

  • (Time, nil)

    when this record was created, or nil if unavailable



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#last_modifiedTime?

Returns when this record was last modified, or nil if unavailable.

Returns:

  • (Time, nil)

    when this record was last modified, or nil if unavailable



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#plainHash<String, String>

Returns this record's plaintext record metadata.

Returns:

  • (Hash<String, String>)

    this record's plaintext record metadata



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#record_idString?

Returns the unique ID of this record, or nil if not yet written.

Returns:

  • (String, nil)

    the unique ID of this record, or nil if not yet written



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#typeString

Returns a free-form description of record content type.

Returns:

  • (String)

    a free-form description of record content type



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#user_idString

Returns the subject client ID (currently == writer_id).

Returns:

  • (String)

    the subject client ID (currently == writer_id)



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#versionString

Returns opaque version identifier updated by server on changes.

Returns:

  • (String)

    opaque version identifier updated by server on changes



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end

#writer_idString

Returns the client ID that wrote this record.

Returns:

  • (String)

    the client ID that wrote this record



94
95
96
97
98
99
100
101
102
103
# File 'lib/e3db/client.rb', line 94

class Meta < Dry::Struct
  attribute :record_id, Types::Strict::String.optional
  attribute :writer_id, Types::Strict::String
  attribute :user_id, Types::Strict::String
  attribute :type, Types::Strict::String
  attribute :plain, Types::Strict::Hash.default { Hash.new }
  attribute :created, Types::Json::DateTime.optional
  attribute :last_modified, Types::Json::DateTime.optional
  attribute :version, Types::Strict::String.optional
end