Sha256: fef06ee3e9d079d97124569c017e3cfb6f705126111413a50a3d6c05a2661c98

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

class Type

  def self.check(actual, expected)
    raise(UnsupportedTypeException.new, "Target must be of type: #{expected} but was: #{actual.class}") unless actual.kind_of?(expected)
  end

  def self.responds(value,meth)
    raise(UnsupportedTypeException.new, "Target must respond to: #{meth} - but did not with: #{value.class} of: #{value}") unless value.respond_to?(meth)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
totally_lazy-0.0.3 lib/type_check.rb