Method: NestedRecord::Collection#<<

Defined in:
lib/nested_record/collection.rb

#<<(obj) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/nested_record/collection.rb', line 35

def <<(obj)
  unless obj.kind_of?(record_class)
    raise NestedRecord::TypeMismatchError, "#{obj.inspect} should be a #{record_class}"
  end
  @ary << obj
  self
end