Sha256: 262bd92526e370ef6f64d8779cd7f1ce7f43a92a712af2e4fadfcb681a9c527f
Contents?: true
Size: 356 Bytes
Versions: 69
Compression:
Stored size: 356 Bytes
Contents
# frozen_string_literal: true module ReeEnum::Contractable include Ree::Contracts::Truncatable def valid?(value) value.is_a?(ReeEnum::Value) && value.enum_name == self.enum_name && all.include?(value) end def message(value, name, lvl = 1) return "expected one of #{self.name}, got #{value.class} => #{truncate(value.inspect)}" end end
Version data entries
69 entries across 69 versions & 1 rubygems