Module: DataMapper::Assertions
- Included in:
- DataMapper, DataMapper::Adapters::AbstractAdapter, Associations, DataMapper::Associations::ManyToMany, DataMapper::Associations::ManyToOne, DataMapper::Associations::ManyToOne::Proxy, DataMapper::Associations::OneToMany, DataMapper::Associations::OneToMany::Proxy, DataMapper::Associations::OneToOne, DataMapper::Associations::Relationship, Collection, Property, PropertySet, Query, Query::Direction, Query::Operator, Query::Path, Repository, Resource
- Defined in:
- lib/gems/dm-core-0.9.9/lib/dm-core/support/assertions.rb
Instance Method Summary collapse
Instance Method Details
#assert_kind_of(name, value, *klasses) ⇒ Object
3 4 5 6 |
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/support/assertions.rb', line 3 def assert_kind_of(name, value, *klasses) klasses.each { |k| return if value.kind_of?(k) } raise ArgumentError, "+#{name}+ should be #{klasses.map { |k| k.name } * ' or '}, but was #{value.class.name}", caller(2) end |