summaryrefslogtreecommitdiff
path: root/lib/leap_ca/couch_changes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_ca/couch_changes.rb')
-rw-r--r--lib/leap_ca/couch_changes.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/leap_ca/couch_changes.rb b/lib/leap_ca/couch_changes.rb
index 59209a4..1777eea 100644
--- a/lib/leap_ca/couch_changes.rb
+++ b/lib/leap_ca/couch_changes.rb
@@ -1,17 +1,19 @@
-class CouchChanges
- def initialize(stream)
- @stream = stream
- end
+module LeapCA
+ class CouchChanges
+ def initialize(stream)
+ @stream = stream
+ end
- def last_seq
- @stream.get "_changes", :limit => 1, :descending => true do |hash|
- return hash[:last_seq]
+ def last_seq
+ @stream.get "_changes", :limit => 1, :descending => true do |hash|
+ return hash[:last_seq]
+ end
end
- end
- def follow
- @stream.get "_changes", :feed => :continuous, :since => last_seq do |hash|
- yield(hash)
+ def follow
+ @stream.get "_changes", :feed => :continuous, :since => last_seq do |hash|
+ yield(hash)
+ end
end
end
-end
+end \ No newline at end of file