Class: MongoidAutoInc::Incrementor
- Inherits:
-
Object
- Object
- MongoidAutoInc::Incrementor
- Defined in:
- lib/mongoid_auto_inc/incrementor.rb
Defined Under Namespace
Classes: Sequence
Instance Method Summary collapse
- #[](sequence) ⇒ Object
- #[]=(sequence, number) ⇒ Object
-
#initialize(options = nil) ⇒ Incrementor
constructor
A new instance of Incrementor.
Constructor Details
#initialize(options = nil) ⇒ Incrementor
Returns a new instance of Incrementor.
52 53 54 55 56 |
# File 'lib/mongoid_auto_inc/incrementor.rb', line 52 def initialize(=nil) ||= {} @collection = [:collection] || "sequences" @seed = [:seed].to_i end |