Class: Phronomy::Persistence
- Inherits:
-
Object
- Object
- Phronomy::Persistence
- Defined in:
- lib/phronomy/persistence.rb,
lib/phronomy/persistence/in_memory.rb
Defined Under Namespace
Classes: ConflictError, InMemory, NotFoundError, UnsupportedBackendError
Instance Attribute Summary collapse
-
#activations ⇒ Object
readonly
Returns the value of attribute activations.
-
#agents ⇒ Object
readonly
Returns the value of attribute agents.
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#executions ⇒ Object
readonly
Returns the value of attribute executions.
-
#journals ⇒ Object
readonly
Returns the value of attribute journals.
Instance Method Summary collapse
- #capabilities ⇒ Object
-
#initialize(contents:, agents:, journals:, executions:, activations:) ⇒ Persistence
constructor
A new instance of Persistence.
- #transaction ⇒ Object
Constructor Details
#initialize(contents:, agents:, journals:, executions:, activations:) ⇒ Persistence
Returns a new instance of Persistence.
11 12 13 14 15 16 17 18 |
# File 'lib/phronomy/persistence.rb', line 11 def initialize(contents:, agents:, journals:, executions:, activations:) @contents = contents @agents = agents @journals = journals @executions = executions @activations = activations validate_capabilities! end |
Instance Attribute Details
#activations ⇒ Object (readonly)
Returns the value of attribute activations.
9 10 11 |
# File 'lib/phronomy/persistence.rb', line 9 def activations @activations end |
#agents ⇒ Object (readonly)
Returns the value of attribute agents.
9 10 11 |
# File 'lib/phronomy/persistence.rb', line 9 def agents @agents end |
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
9 10 11 |
# File 'lib/phronomy/persistence.rb', line 9 def contents @contents end |
#executions ⇒ Object (readonly)
Returns the value of attribute executions.
9 10 11 |
# File 'lib/phronomy/persistence.rb', line 9 def executions @executions end |
#journals ⇒ Object (readonly)
Returns the value of attribute journals.
9 10 11 |
# File 'lib/phronomy/persistence.rb', line 9 def journals @journals end |
Instance Method Details
#capabilities ⇒ Object
20 21 22 |
# File 'lib/phronomy/persistence.rb', line 20 def capabilities {atomic_all: false, atomic_admission: false}.freeze end |
#transaction ⇒ Object
24 25 26 |
# File 'lib/phronomy/persistence.rb', line 24 def transaction raise UnsupportedBackendError, "#{self.class} does not provide atomic_all" end |