Class: Minidoc::Grid

Inherits:
Mongo::Grid
  • Object
show all
Defined in:
lib/minidoc/grid.rb

Instance Method Summary collapse

Instance Method Details

#delete(id) ⇒ Object



12
13
14
15
# File 'lib/minidoc/grid.rb', line 12

def delete(id)
  id = BSON::ObjectId(id.to_s)
  super(id)
end

#get(id) ⇒ Object



2
3
4
5
# File 'lib/minidoc/grid.rb', line 2

def get(id)
  id = BSON::ObjectId(id.to_s)
  super(id)
end

#get_json(id) ⇒ Object



7
8
9
10
# File 'lib/minidoc/grid.rb', line 7

def get_json(id)
  raw_data = get(id).read
  JSON.parse(raw_data)
end