Sha256: f6d7304f42ead7ea25918bb8159a4ff967201e1cb16b77db09de47cfad9a4341
Contents?: true
Size: 400 Bytes
Versions: 5
Compression:
Stored size: 400 Bytes
Contents
require "contracts" # Aruba module Aruba # Contracts module Contracts # Enum class Enum < ::Contracts::CallableClass private attr_reader :vals public # Create contract def initialize(*vals) super() @vals = vals end # Check if value is part of array def valid?(val) vals.include? val end end end end
Version data entries
5 entries across 5 versions & 2 rubygems