Class: Faststep::Db
- Inherits:
-
Object
- Object
- Faststep::Db
- Defined in:
- lib/faststep/db.rb,
ext/faststep/db.c
Instance Attribute Summary collapse
- #connection ⇒ Object readonly
- #name ⇒ Object readonly
Instance Method Summary collapse
- #collection(collection_name) ⇒ Object (also: #[])
- #collection_names ⇒ Object
- #collections ⇒ Object
- #command ⇒ Object
- #drop ⇒ Object
- #get_last_error ⇒ Object
- #initialize ⇒ Object constructor
Constructor Details
#initialize ⇒ Object
Instance Attribute Details
#connection ⇒ Object (readonly)
#name ⇒ Object (readonly)
Instance Method Details
#collection(collection_name) ⇒ Object Also known as: []
3 4 5 |
# File 'lib/faststep/db.rb', line 3 def collection(collection_name) Collection.new(collection_name, self) end |
#collection_names ⇒ Object
7 8 9 10 11 |
# File 'lib/faststep/db.rb', line 7 def collection_names names = collections_info.map {|doc| doc["name"] } names.reject! {|name| name.index(@name).nil? || name.index('$') } names.map {|name| name.sub("#{@name}.", "") } end |
#collections ⇒ Object
13 14 15 16 17 |
# File 'lib/faststep/db.rb', line 13 def collections collection_names.map do |collection_name| Collection.new(collection_name, self) end end |