Class: Contract::Check::Block

Inherits:
Base
  • Object
show all
Defined in:
lib/contract/integration.rb

Overview

Checks that the specified block matches. Example:

signature :x, Contract::Check.block { |arg| arg > 0 }

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Contract::Check::Base

Instance Method Details

#===(other) ⇒ Object



37
38
39
# File 'lib/contract/integration.rb', line 37

def ===(other)
  @block.call(other)
end