Sha256: f8c793d8b1a0093ad157839fb4650beee741cc911059c5cbe3cd2632539eb3a3
Contents?: true
Size: 613 Bytes
Versions: 1
Compression:
Stored size: 613 Bytes
Contents
module Dry module Data class Type class Array < Type def self.constructor(array_constructor, member_constructor, input) array_constructor[input].map { |value| member_constructor[value] } end def member(type) member_constructor = case type when String, Class then Data[type] else type end array_constructor = self.class .method(:constructor).to_proc.curry.(constructor, member_constructor) self.class.new(array_constructor, primitive) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dry-data-0.4.2 | lib/dry/data/type/array.rb |