Class: ConcurrentPipeline::Stores::Yaml::History::Version
- Inherits:
-
Object
- Object
- ConcurrentPipeline::Stores::Yaml::History::Version
- Defined in:
- lib/concurrent_pipeline/stores/yaml/history.rb
Instance Attribute Summary collapse
-
#changesets ⇒ Object
readonly
Returns the value of attribute changesets.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(index:, changesets:, registry:) ⇒ Version
constructor
A new instance of Version.
- #store ⇒ Object
Constructor Details
#initialize(index:, changesets:, registry:) ⇒ Version
Returns a new instance of Version.
14 15 16 17 18 |
# File 'lib/concurrent_pipeline/stores/yaml/history.rb', line 14 def initialize(index:, changesets:, registry:) @index = index @changesets = changesets[0..index] @registry = registry end |
Instance Attribute Details
#changesets ⇒ Object (readonly)
Returns the value of attribute changesets.
13 14 15 |
# File 'lib/concurrent_pipeline/stores/yaml/history.rb', line 13 def changesets @changesets end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
13 14 15 |
# File 'lib/concurrent_pipeline/stores/yaml/history.rb', line 13 def index @index end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
13 14 15 |
# File 'lib/concurrent_pipeline/stores/yaml/history.rb', line 13 def registry @registry end |
Instance Method Details
#diff ⇒ Object
29 30 31 |
# File 'lib/concurrent_pipeline/stores/yaml/history.rb', line 29 def diff changesets.last.as_json end |
#store ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/concurrent_pipeline/stores/yaml/history.rb', line 20 def store @store ||= ( Db .new(data: {}, registry: registry) .tap { _1.apply(changesets) } .reader ) end |