Class: Flows::Contract::Predicate
- Inherits:
-
Flows::Contract
- Object
- Flows::Contract
- Flows::Contract::Predicate
- Defined in:
- lib/flows/contract/predicate.rb
Overview
Makes a contract from 1-argument lambda.
Such lambdas works like predicates.
Instance Method Summary collapse
- #check!(other) ⇒ Object
-
#initialize(error_message) {|object| ... } ⇒ Predicate
constructor
A new instance of Predicate.
Methods inherited from Flows::Contract
#===, #check, make, #to_proc, #transform, #transform!
Constructor Details
#initialize(error_message) {|object| ... } ⇒ Predicate
Returns a new instance of Predicate.
21 22 23 24 |
# File 'lib/flows/contract/predicate.rb', line 21 def initialize(, &block) @error_message = @block = block end |