Sha256: dc8f4b5223201eec993ca4eccb0d72696bfb40c901a7289b68862482375650d3

Contents?: true

Size: 323 Bytes

Versions: 2

Compression:

Stored size: 323 Bytes

Contents

# encoding: utf-8

module Mixture
  module Coerce
    # Handles coercion of the Array class.
    class Array < Base
      type Type::Array

      coerce_to(Type::Object, Itself)
      coerce_to(Type::Array, Itself)
      coerce_to(Type::Set, :to_set)
      coerce_to(Type::Hash) { |value| ::Hash[value] }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mixture-0.2.0 lib/mixture/coerce/array.rb
mixture-0.1.0 lib/mixture/coerce/array.rb