Skip to content

Commit

Permalink
Merge pull request #4 from jmagee/master
Browse files Browse the repository at this point in the history
add collection as a config option
  • Loading branch information
Pius Uzamere committed Jan 27, 2012
2 parents a784ddc + b562b5c commit bd877be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/rdf/mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit bd877be

Please sign in to comment.