Takes a variable number of method names as symbols. Given an argument, all
of those methods are called on the argument one by one. If they all return
true, the contract passes. Example: Send[:valid?]
# File lib/contracts/builtin_contracts.rb, line 187 def initialize(*meths) @meths = meths end
# File lib/contracts/builtin_contracts.rb, line 197 def to_s "a value that returns true for all of #{@meths.inspect}" end
# File lib/contracts/builtin_contracts.rb, line 191 def valid?(val) @meths.all? do |meth| val.send(meth) end end