require 'net/http'
require 'net/https'
require 'uri'
require 'json'

require 'rubycouch/client'
require 'rubycouch/definitions'
require 'rubycouch/document'
require 'rubycouch/database'
require 'rubycouch/instance'

class RubyCouch
  def self.demo
    client = RubyClient.new(URI.parse('http://localhost:5984'))
    client.make_request(InstanceInfo.new)
  end
end



require 'net/http'
require 'net/https'
require 'uri'
require 'json'

require 'rubycouch/client'
require 'rubycouch/definitions'
require 'rubycouch/document'
require 'rubycouch/view'
require 'rubycouch/database'
require 'rubycouch/instance'

class RubyCouch
  def self.demo
    client = CouchClient.new(URI.parse('http://localhost:5984'))

    print "====== InstanceInfo ======\n"
    print client.make_request(InstanceInfo.new)

    print "\n\n====== AllDbs ======\n"
    print client.make_request(AllDbs.new)

    database = client.database('animaldb')

    print "\n\n====== animaldb -- DatabaseInfo ======\n"
    print database.make_request(DatabaseInfo.new)

    print "\n\n====== animaldb -- AllDocs ======\n"
    print database.make_request(AllDocs.new)

    print "\n\n====== animaldb -- GetDocument(elephant) ======\n"
    print database.make_request(GetDocument.new('elephant'))

    print "\n\n====== animaldb -- GetView(view101) ======\n"
    print database.make_request(GetView.new('views101', 'latin_name'))

    print "\n\n====== animaldb -- GetView Reduced(view101) ======\n"
    get_view = GetView.new('views101', 'latin_name_count')
    get_view.merge_query_items({:reduce => true})
    print database.make_request(get_view)

    print "\n\ndone.\n"
  end
end



Update the demo listing to show more functionality
Update the demo listing to show more functionality
