Module: Kernel
- Defined in:
- lib/insist.rb
Overview
class Reject
Instance Method Summary collapse
-
#insist(&block) ⇒ Object
A shortcut to ‘Insist.new’.
-
#reject(&block) ⇒ Object
A shortcut to ‘Reject.new’.
Instance Method Details
#insist(&block) ⇒ Object
A shortcut to ‘Insist.new’
Example:
insist { "hello world" } != "fizzle"
65 66 67 |
# File 'lib/insist.rb', line 65 def insist(&block) return Insist.new(&block) end |
#reject(&block) ⇒ Object
A shortcut to ‘Reject.new’
Example:
# This will fail (raises Insist::Failure)
reject { [1,2,3,4] }.include?(3)
# This will succeed
reject { [1,2,3,4] }.include?(4)
78 79 80 |
# File 'lib/insist.rb', line 78 def reject(&block) return Reject.new(&block) end |