Sha256: 17f5efff08ffd7849b00dc6d3165df5b3c12e7c7ef6e804f650623e86fa9954c

Contents?: true

Size: 395 Bytes

Versions: 2

Compression:

Stored size: 395 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

module Mixture
  module Types
    # An enumerable.  This is any value that inherits `Enumerable`.
    class Enumerable < Object
      options[:primitive] = ::Enumerable
      constraint do |value|
        # include Enumerable adds Enumerable to the ancestors list.
        value.class.ancestors.include?(::Enumerable)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mixture-0.7.1 lib/mixture/types/enumerable.rb
mixture-0.7.0 lib/mixture/types/enumerable.rb