Class: Mongoid::Contextual::Aggregable::Commands::Base
- Inherits:
-
Hash
- Object
- Hash
- Mongoid::Contextual::Aggregable::Commands::Base
- Defined in:
- lib/mongoid/contextual/aggregable/commands/base.rb
Instance Method Summary collapse
-
#initialize(name, *args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name, *args) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/mongoid/contextual/aggregable/commands/base.rb', line 7 def initialize(name, *args) values = args.inject({}) { |res, hash| res.merge(hash) } self[name] = values end |