class Rtype::Behavior::Not
Public Class Methods
new(*types)
click to toggle source
# File lib/rtype/behavior/not.rb, line 4 def initialize(*types) @types = types end
Public Instance Methods
error_message(value)
click to toggle source
# File lib/rtype/behavior/not.rb, line 14 def error_message(value) arr = @types.map { |e| "NOT " + Rtype::type_error_message(e, value) } arr.join "\nAND " end
valid?(value)
click to toggle source
# File lib/rtype/behavior/not.rb, line 8 def valid?(value) @types.all? do |e| !Rtype::valid?(e, value) end end