Sha256: 301dd98889eebdcb34fc74fdf4b628830245a5418e6266f90b667be1f4d8b7ed

Contents?: true

Size: 279 Bytes

Versions: 15

Compression:

Stored size: 279 Bytes

Contents

module Ardm
  module Assertions
    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
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ardm-0.4.0.ar427 lib/ardm/support/assertions.rb
ardm-0.4.0 lib/ardm/support/assertions.rb
ardm-0.3.2 lib/ardm/support/assertions.rb
ardm-0.3.1 lib/ardm/support/assertions.rb
ardm-0.3.0 lib/ardm/support/assertions.rb
ardm-0.2.7 lib/ardm/support/assertions.rb
ardm-0.2.6 lib/ardm/support/assertions.rb
ardm-0.2.5 lib/ardm/support/assertions.rb
ardm-0.2.4 lib/ardm/support/assertions.rb
ardm-0.2.3 lib/ardm/support/assertions.rb
ardm-0.2.2 lib/ardm/support/assertions.rb
ardm-0.2.1 lib/ardm/support/assertions.rb
ardm-0.2.0 lib/ardm/support/assertions.rb
ardm-0.1.0 lib/ardm/support/assertions.rb
ardm-0.0.1 lib/ardm/support/assertions.rb