Updated website to reflect proper git repo path
[couchobject.git] / lib / couch_object / view.rb
blob2c1d9d926287dc441986966d50d88b2a9a3a6bb3
1 require "enumerator"
3 module CouchObject
4   class View
5     def self.create(db, name, query)
6       db.post("/#{db.name}/_view_#{name}", query)
7     end
8     
9     def initialize(db, name)
10       @db = db
11       @name = name
12     end
13     attr_accessor :db
14     
15     def name
16       "_view_#{@name.dup}"
17     end
18     
19     def delete
20       @db.delete("/#{db.name}/#{name}")
21     end
22   end
23 end