Class: EntitySnapshot::Postgres::ReadOnly

Inherits:
Object
  • Object
show all
Includes:
EntityCache::Store::External, Get, Log::Dependency
Defined in:
lib/entity_snapshot/postgres/read_only.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Get

#get, prepended

Instance Attribute Details

#sessionObject

Returns the value of attribute session.



11
12
13
# File 'lib/entity_snapshot/postgres/read_only.rb', line 11

def session
  @session
end

Class Method Details

.assure(store) ⇒ Object



29
30
31
32
33
# File 'lib/entity_snapshot/postgres/read_only.rb', line 29

def self.assure(store)
  if store.snapshot_class.nil?
    raise EntityCache::Store::External::Error
  end
end

Instance Method Details

#categoryObject



15
16
17
18
19
# File 'lib/entity_snapshot/postgres/read_only.rb', line 15

def category
  *, entity_class_name = entity_class.name.split('::')

  Casing::Camel.(entity_class_name)
end

#configure(session: nil) ⇒ Object



21
22
23
24
# File 'lib/entity_snapshot/postgres/read_only.rb', line 21

def configure(session: nil)
  MessageStore::Postgres::Session.configure(self, session: session)
  MessageStore::Postgres::Get::Last.configure(self, session: self.session, attr_name: :read)
end

#putObject



26
27
# File 'lib/entity_snapshot/postgres/read_only.rb', line 26

def put(*)
end