Class: Holistic::Document::Unsaved::Collection
- Inherits:
-
Object
- Object
- Holistic::Document::Unsaved::Collection
- Defined in:
- lib/holistic/document/unsaved/collection.rb
Instance Method Summary collapse
- #add(path:, content:) ⇒ Object
- #delete(path) ⇒ Object
- #find(path) ⇒ Object
-
#initialize ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize ⇒ Collection
Returns a new instance of Collection.
5 6 7 |
# File 'lib/holistic/document/unsaved/collection.rb', line 5 def initialize @items = {} end |
Instance Method Details
#add(path:, content:) ⇒ Object
9 10 11 |
# File 'lib/holistic/document/unsaved/collection.rb', line 9 def add(path:, content:) @items[path] = Unsaved::Record.new(path:, content:) end |
#delete(path) ⇒ Object
13 14 15 |
# File 'lib/holistic/document/unsaved/collection.rb', line 13 def delete(path) @items.delete(path) end |
#find(path) ⇒ Object
17 18 19 |
# File 'lib/holistic/document/unsaved/collection.rb', line 17 def find(path) @items[path] end |