Class: Fog::Storage::Gridfs::Real
- Inherits:
-
Object
- Object
- Fog::Storage::Gridfs::Real
- Defined in:
- lib/fog-gridfs/gridfs/storage.rb
Instance Attribute Summary collapse
-
#fs ⇒ Object
readonly
Returns the value of attribute fs.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #open(*args) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fog-gridfs/gridfs/storage.rb', line 25 def initialize( = {}) host = [:host] port = [:port] || Mongo::Connection::DEFAULT_PORT database = [:database] username = [:username] password = [:password] @connection = Mongo::Connection.new(host, port) @database = @connection.db(database) if username @database.authenticate(username, password) end @fs = Mongo::GridFileSystem.new(@database) end |
Instance Attribute Details
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
23 24 25 |
# File 'lib/fog-gridfs/gridfs/storage.rb', line 23 def fs @fs end |
Instance Method Details
#open(*args) ⇒ Object
41 42 43 |
# File 'lib/fog-gridfs/gridfs/storage.rb', line 41 def open(*args) @fs.open(*args) end |