Sha256: f944556aecfe99e3b89e56c98f11f9685f3d20f9b81e841747b4038e1f9be7e8
Contents?: true
Size: 658 Bytes
Versions: 11
Compression:
Stored size: 658 Bytes
Contents
require 'genesis_ruby/utils/common' module GenesisRuby module Api module Mixins module Constants # Common method between all Constant classes # use extend to add methods below to a specific module module Common # Get all defined constant values def all GenesisRuby::Utils::Common.constant_values(self) end # Validate given value against all available constant values def valid?(value, strict: false) value = value.downcase if !strict && value.is_a?(String) all.include?(value) end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems