class Rtype::Behavior::And

Public Class Methods

new(*types) click to toggle source
# File lib/rtype/behavior/and.rb, line 4
def initialize(*types)
        @types = types
end

Public Instance Methods

error_message(value) click to toggle source
# File lib/rtype/behavior/and.rb, line 14
def error_message(value)
        arr = @types.map { |e| Rtype::type_error_message(e, value) }
        arr.join "\nAND "
end
valid?(value) click to toggle source
# File lib/rtype/behavior/and.rb, line 8
def valid?(value)
        @types.all? do |e|
                Rtype::valid? e, value
        end
end