Class: Mongoid::Contextual::Aggregable::Commands::Base

Inherits:
Hash
  • Object
show all
Defined in:
lib/mongoid/contextual/aggregable/commands/base.rb

Direct Known Subclasses

Group, Limit, Match, Or, Project, Sort, Unwind

Instance Method Summary collapse

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