Permalink
Browse files

Merge pull request #4 from jmagee/master

add collection as a config option
  • Loading branch information...
Pius Uzamere
Pius Uzamere committed Jan 27, 2012
2 parents a784ddc + b562b5c commit bd877be4e902496c8b5625d9d293d4b8cd1bc8cc
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/rdf/mongo.rb
View
@@ -117,12 +117,13 @@ class Repository < ::RDF::Repository
# @option options [String] :host
# @option options [Integer] :port
# @option options [String] :db
+ # @option options [String] :collection ('quads')
# @yield [repository]
# @yieldparam [Repository] repository
def initialize(options = {}, &block)
- options = {:host => 'localhost', :port => 27017, :db => 'quadb'}.merge(options)
+ options = {:host => 'localhost', :port => 27017, :db => 'quadb', :collection => 'quads'}.merge(options)
@db = ::Mongo::Connection.new(options[:host], options[:port]).db(options[:db])
- @coll = @db['quads']
+ @coll = @db[options[:collection]]
@coll.create_index("s")
@coll.create_index("p")
@coll.create_index("o")

0 comments on commit bd877be

Please sign in to comment.