Class: Yoda::Store::Registry::LocalStore
- Inherits:
-
Object
- Object
- Yoda::Store::Registry::LocalStore
- Defined in:
- lib/yoda/store/registry/local_store.rb
Instance Attribute Summary collapse
- #on_change ⇒ Proc? readonly
Instance Method Summary collapse
- #add_file_patch(patch) ⇒ Object
- #find_file_patch(id) ⇒ Objects::Patch?
-
#initialize(on_change: nil) ⇒ LocalStore
constructor
A new instance of LocalStore.
- #registry ⇒ Registry::Index::ComposerWrapper
- #remove_file_patch(patch) ⇒ Object
Constructor Details
#initialize(on_change: nil) ⇒ LocalStore
Returns a new instance of LocalStore.
9 10 11 |
# File 'lib/yoda/store/registry/local_store.rb', line 9 def initialize(on_change: nil) @on_change = on_change end |
Instance Attribute Details
#on_change ⇒ Proc? (readonly)
6 7 8 |
# File 'lib/yoda/store/registry/local_store.rb', line 6 def on_change @on_change end |
Instance Method Details
#add_file_patch(patch) ⇒ Object
19 20 21 22 |
# File 'lib/yoda/store/registry/local_store.rb', line 19 def add_file_patch(patch) registry.add_registry(patch) on_change&.call end |
#find_file_patch(id) ⇒ Objects::Patch?
32 33 34 |
# File 'lib/yoda/store/registry/local_store.rb', line 32 def find_file_patch(id) registry.get_registry(id) end |
#registry ⇒ Registry::Index::ComposerWrapper
14 15 16 |
# File 'lib/yoda/store/registry/local_store.rb', line 14 def registry @registry ||= Registry::Index.new.wrap(Registry::Composer.new(id: :local)) end |
#remove_file_patch(patch) ⇒ Object
25 26 27 28 |
# File 'lib/yoda/store/registry/local_store.rb', line 25 def remove_file_patch(patch) registry.remove_registry(patch) on_change&.call end |