Method: Cot::Collection#initialize
- Defined in:
- lib/cot/collection.rb
#initialize(*params) ⇒ Collection
We take an array of params here and then parse them due to backwards compat crap Collection can take 1-3 parameters and there are two cases when it gets two 3: klass, objects, options 2: klass, objects 2: objects, options 1: objects
11 12 13 14 15 16 17 18 |
# File 'lib/cot/collection.rb', line 11 def initialize(*params) parse_params(params) # If you pass in different types of things here we can't be friends initialize_objects(@objects) unless @objects.first.instance_of? self.class.klass super @objects end |