Module: Edr::Repository

Included in:
AR::Repository
Defined in:
lib/edr/repository.rb

Instance Method Summary collapse

Instance Method Details

#allObject



17
18
19
20
21
# File 'lib/edr/repository.rb', line 17

def all
  data_class.find_all.map do |data|
    wrap(data)
  end
end

#delete(model) ⇒ Object



5
6
7
# File 'lib/edr/repository.rb', line 5

def delete model
  data_class.destroy data(model)
end

#delete_by_id(id) ⇒ Object



9
10
11
# File 'lib/edr/repository.rb', line 9

def delete_by_id id
  data_class.destroy(data_class.get!(id))
end

#find(id) ⇒ Object



13
14
15
# File 'lib/edr/repository.rb', line 13

def find id
  wrap(data_class.get!(id))
end