lib/rackamole/store/mongo.rb in rackamole-0.0.2 vs lib/rackamole/store/mongo.rb in rackamole-0.0.3
- old
+ new
@@ -10,13 +10,13 @@
# the features collection.
class Mongo
attr_reader :connection
- def initialize( options )
+ def initialize( options={} )
opts = default_options.merge( options )
- @connection = Connection.new( opts[:hostname], opts[:port] ).db( opts[:database] )
+ @connection = Connection.new( opts[:host], opts[:port] ).db( opts[:database] )
end
# clear out db content
def reset!
features.clear
@@ -50,10 +50,10 @@
# Set up mongo default options ie localhost host, default mongo port and
# the database being mole_mdb
def default_options
{
:host => 'localhost',
- :port => 77926,
+ :port => 27017,
:database => 'mole_mdb'
}
end
# retrieves a feature if exists or create a new one otherwise
\ No newline at end of file