Sha256: 804d675db841a3b08c93b34766e269bd5e77960634bfae7ae862af5775428f6e
Contents?: true
Size: 530 Bytes
Versions: 13
Compression:
Stored size: 530 Bytes
Contents
module SoberSwag module Nodes ## # Compiler node to represent an enum value. # Enums are special enough to have their own node. class Enum < Base def initialize(values) @values = values end attr_reader :values def map(&block) self.class.new(@values.map(&block)) end def deconstruct [values] end def deconstruct_keys(_keys) { values: values } end def cata(&block) block.call(dup) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems