Module: DataMapper::Model

Defined in:
lib/sinatra/rest/adapters.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) delete(id)



20
21
22
23
# File 'lib/sinatra/rest/adapters.rb', line 20

def delete(id)
  model = self.find_by_id(id)
  model.destroy if model
end

- (Object) find_by_id(id)



16
17
18
# File 'lib/sinatra/rest/adapters.rb', line 16

def find_by_id(id)
  get(id)
end