Exception: KindAssay

Inherits:
Assertion show all
Defined in:
lib/assay/kind_assay.rb

Overview

Comparison assertion for #kind_of?

KindAssay.pass?(1, Integer)  #=> true
KindAssay.fail?(1, String)   #=> true

Direct Known Subclasses

InstanceAssay

Constant Summary

Constants inherited from Assertion

Assertion::SIZE_LIMIT

Constants included from Assay::Assertable

Assay::Assertable::SIZE_LIMIT

Class Method Summary collapse

Methods inherited from Assertion

by_name, by_operator, inherited, register, subclasses

Methods included from Assay::Assertable

#[], #assert!, #assert_message, #assertive_name, #assertor, #fail?, #operator, #pass?, #refute!, #refute_message

Class Method Details

.pass?(object, class_type) ⇒ Boolean

Check assertion.

Returns:

  • (Boolean)


13
14
15
# File 'lib/assay/kind_assay.rb', line 13

def self.pass?(object, class_type)
  object.kind_of?(class_type)
end