Class: Reject

Inherits:
Insist show all
Defined in:
lib/insist.rb

Overview

Like Insist, but rejects (fails) on truthy values instead falsey ones.

Constant Summary

Constants included from Insist::Predicates

Insist::Predicates::PREDICATE_METHOD_RE

Instance Method Summary collapse

Methods inherited from Insist

#initialize, #value

Methods included from Insist::Predicates

#is_a?, #method_missing, #respond_to?

Methods included from Insist::Raises

#fails, #raises

Methods included from Insist::Nil

#nil?

Methods included from Insist::Enumerables

#include?

Methods included from Insist::Comparators

#!=, #!~, #<, #<=, #==, #=~, #>, #>=

Constructor Details

This class inherits a constructor from Insist

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Insist::Predicates

Instance Method Details

#assert(truthy, message) ⇒ Object

Raises:



54
55
56
# File 'lib/insist.rb', line 54

def assert(truthy, message)
  raise Insist::Failure.new(message) if truthy
end