Class: Holistic::Document::Unsaved::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/holistic/document/unsaved/collection.rb

Instance Method Summary collapse

Constructor Details

#initializeCollection

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