Class: Ardtweeno::DB
- Inherits:
-
Object
- Object
- Ardtweeno::DB
- Defined in:
- lib/ardtweeno/db.rb
Overview
Ardtweeno::DB class to handle communication with a MongoDB Database
Class Attribute Summary collapse
-
.auth ⇒ Object
Returns the value of attribute auth.
-
.coll ⇒ Object
Returns the value of attribute coll.
-
.dbconnector ⇒ Object
Returns the value of attribute dbconnector.
-
.log ⇒ Object
Returns the value of attribute log.
Class Method Summary collapse
-
.initialize ⇒ Object
Ardtweeno::DB#new Constructor.
Class Attribute Details
.auth ⇒ Object
Returns the value of attribute auth.
42 43 44 |
# File 'lib/ardtweeno/db.rb', line 42 def auth @auth end |
.coll ⇒ Object
Returns the value of attribute coll.
42 43 44 |
# File 'lib/ardtweeno/db.rb', line 42 def coll @coll end |
.dbconnector ⇒ Object
Returns the value of attribute dbconnector.
42 43 44 |
# File 'lib/ardtweeno/db.rb', line 42 def dbconnector @dbconnector end |
.log ⇒ Object
Returns the value of attribute log.
42 43 44 |
# File 'lib/ardtweeno/db.rb', line 42 def log @log end |
Class Method Details
.initialize ⇒ Object
Ardtweeno::DB#new Constructor
-
Args :
-
++ -> newNode String, newKey String, options HashString,
-
:version String, :sensors Array
-
Returns : -
-
Raises :
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ardtweeno/db.rb', line 54 def initialize @log = Ardtweeno.[:log] ||= Logger.new(STDOUT) @log.level = Ardtweeno.[:level] ||= Logger::DEBUG @dbconnector = Mongo::Connection.new(host, port).db(databaseName) @auth = @dbconnector.authenticate(my_user_name, my_password) @coll = @dbconnector.collection(collName) end |