Class: E3DB::Meta
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- E3DB::Meta
- 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
-
#created ⇒ Time?
When this record was created, or nil if unavailable.
-
#last_modified ⇒ Time?
When this record was last modified, or nil if unavailable.
-
#plain ⇒ Hash<String, String>
This record's plaintext record metadata.
-
#record_id ⇒ String?
The unique ID of this record, or nil if not yet written.
-
#type ⇒ String
A free-form description of record content type.
-
#user_id ⇒ String
The subject client ID (currently == writer_id).
-
#version ⇒ String
Opaque version identifier updated by server on changes.
-
#writer_id ⇒ String
The client ID that wrote this record.
Instance Attribute Details
#created ⇒ Time?
Returns 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_modified ⇒ Time?
Returns 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 |
#plain ⇒ Hash<String, String>
Returns 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_id ⇒ String?
Returns 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 |
#type ⇒ String
Returns 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_id ⇒ String
Returns 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 |
#version ⇒ String
Returns 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_id ⇒ String
Returns 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 |