Sha256: a6ccafcd8ffb8e9e27991c8ac92aa2c9a8ee238164d1ae70a42ad7459e9f8dfb

Contents?: true

Size: 687 Bytes

Versions: 6

Compression:

Stored size: 687 Bytes

Contents

module Exegesis
  class Server
    include Exegesis::Http
    
    attr_accessor :uri, :version

    # Creates a new instance of Exegesis::Server. Defaults to http://localhost:5984 and
    # verifies the existance of the database.
    def initialize address='http://localhost:5984'
      @uri = address
      @version = get(@uri)['version']
    end
    
    # returns an array of all the databases on the server
    def databases
      get "#{@uri}/_all_dbs"
    end
    
    # creates a database with the given name on the server
    def create_database name
      put "#{@uri}/#{name}"
    end
    
    def inspect
      "#<Exegesis::Server:#{object_id} uri=#{@uri}>"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mattly-exegesis-0.2.1 lib/exegesis/server.rb
mattly-exegesis-0.2.2 lib/exegesis/server.rb
mattly-exegesis-0.2.3 lib/exegesis/server.rb
mattly-exegesis-0.2.5 lib/exegesis/server.rb
mattly-exegesis-0.2.6 lib/exegesis/server.rb
mattly-exegesis-0.2.8 lib/exegesis/server.rb