Sha256: 4da15f063b3778a12c1a4c847e94a5f34d87e29478d73ef9c96729d87ca3d033

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 Bytes

Contents

module SoberSwag
  module Nodes
    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

1 entries across 1 versions & 1 rubygems

Version Path
sober_swag-0.1.0 lib/sober_swag/nodes/enum.rb