Sha256: 954eee8ee6c0366172ea36e9186015afbd3bca6a6bbf7b5a47d1e1ca009ef5b0
Contents?: true
Size: 384 Bytes
Versions: 34
Compression:
Stored size: 384 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) @vals = vals end # Check if value is part of array def valid?(val) vals.include? val end end end end
Version data entries
34 entries across 34 versions & 3 rubygems