Sha256: 564a30eadb43f74079f500984962a596635d66fe1d7f8a25a631f116b039add7
Contents?: true
Size: 506 Bytes
Versions: 6
Compression:
Stored size: 506 Bytes
Contents
module Dry module Data class Type class Enum attr_reader :values attr_reader :type def initialize(values, type) @values = values.freeze @type = type values.each(&:freeze) end def primitive type.primitive end def call(input) case input when Fixnum then type[values[input]] else type[input] end end alias_method :[], :call end end end end
Version data entries
6 entries across 6 versions & 1 rubygems