couchdb_basic 0.0.1.beta → 0.0.2.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/couchdb_basic.rb +12 -2
  2. metadata +1 -1
data/lib/couchdb_basic.rb CHANGED
@@ -82,9 +82,19 @@ class Couchdb
82
82
  _get(url)[:rows]
83
83
  end
84
84
 
85
- def get_all()
85
+ def get_all(args={})
86
+ url = "/_all_docs?include_docs=true"
87
+ if args.has_key?( :skip )
88
+ skip = MultiJson.dump( args[:skip] )
89
+ url << "&skip=#{skip}"
90
+ end
91
+ if args.has_key?( :limit )
92
+ limit = MultiJson.dump( args[:limit] )
93
+ url << "&limit=#{limit}"
94
+ end
86
95
  docs = []
87
- _get("/_all_docs?include_docs=true")[:rows].each{ | row | docs << row[:doc ] }
96
+ _get(url)[:rows].each{ | row | docs << row[:doc ] }
88
97
  docs
89
98
  end
99
+
90
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchdb_basic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta
4
+ version: 0.0.2.beta
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: