Sha256: de65485697f7f366a45fd002c6c9d3dfca47dcd82da7ff5c3906e1bd64404772
Contents?: true
Size: 573 Bytes
Versions: 26
Compression:
Stored size: 573 Bytes
Contents
module Foobara module BuiltinTypes # TODO: rename to Map to avoid thinking of it as an array of pairs which isn't quite the right mental model. module AssociativeArray module Casters class Array < Value::Caster def applicable?(value) value.is_a?(::Array) && value.all? { |element| element.is_a?(::Array) && element.size == 2 } end def applies_message "be a an array of pairs" end def cast(array) array.to_h end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems