Class: MongoModel::MongoOptions
- Inherits:
-
Object
- Object
- MongoModel::MongoOptions
- Defined in:
- lib/mongomodel/support/mongo_options.rb
Constant Summary collapse
- ValidKeys =
[ :conditions, :select, :offset, :limit, :order ]
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(model, options = {}) ⇒ MongoOptions
constructor
A new instance of MongoOptions.
- #to_a ⇒ Object
Constructor Details
#initialize(model, options = {}) ⇒ MongoOptions
Returns a new instance of MongoOptions.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mongomodel/support/mongo_options.rb', line 9 def initialize(model, ={}) .assert_valid_keys(ValidKeys) @model = model @selector = extract_conditions() = () add_type_to_selector end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/mongomodel/support/mongo_options.rb', line 7 def end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
7 8 9 |
# File 'lib/mongomodel/support/mongo_options.rb', line 7 def selector @selector end |
Instance Method Details
#to_a ⇒ Object
20 21 22 |
# File 'lib/mongomodel/support/mongo_options.rb', line 20 def to_a [selector, ] end |