def dress(value, handler = DressHelper.new)
      handler.failed!(self, value) unless looks_a_tuple?(value)

      # Check for missing attributes
      unless (missing = missing_attrs(value, true)).empty?
        handler.fail!("Missing attribute `#{missing.first}`")
      end

      # Uped values, i.e. tuple under construction
      uped = {}

      # Check for extra attributes
      extra = extra_attrs(value, true)
      case extra_type = heading.extra_type
      when NilClass
        handler.fail!("Unrecognized attribute `#{extra.first}`") unless extra.empty?
      when ANY_TYPE
        # ok, nothing to do
      else
        extra.each do |attr|
          handler.deeper(attr) do
            attr_value = value.fetch(attr){|k| value.fetch(attr.to_sym) }
            uped[attr.to_sym] = extra_type.dress(attr_value, handler)
          end
        end
      end

      # Up each attribute in turn now. Fail on missing ones.
      heading.each do |attribute|
        present = true
        val = attribute.fetch_on(value){ present = false }
        next unless present
        handler.deeper(attribute.name) do
          uped[attribute.name] = attribute.type.dress(val, handler)
        end
      end

      uped
    end
def dress(value, handler = DressHelper.new)
      handler.failed!(self, value) unless looks_a_tuple?(value)

      # Check for missing attributes
      unless (missing = missing_attrs(value, true)).empty?
        handler.fail!("Missing attribute `#{missing.first}`")
      end

      # Uped values, i.e. tuple under construction
      uped = {}

      # Check for extra attributes
      extra = extra_attrs(value, true)
      case extra_type = heading.extra_type
      when NilClass
        handler.fail!("Unrecognized attribute `#{extra.first}`") unless extra.empty?
      when ANY_TYPE
        # ok, nothing to do
      else
        extra.each do |attr|
          handler.deeper(attr) do
            attr_value = value.fetch(attr){|k| value.fetch(attr.to_sym) }
            uped[attr.to_sym] = extra_type.dress(attr_value, handler)
          end
        end
      end

      # Up each attribute in turn now. Fail on missing ones.
      heading.each do |attribute|
        present = true
        val = attribute.fetch_on(value){ present = false }
        next unless present
        handler.deeper(attribute.name) do
          uped[attribute.name] = attribute.type.dress(val, handler)
        end
      end

      uped
    end
Convert `value` (supposed to be Hash) to a Tuple, by checking attributes
 and applying `dress` on them in turn. Raise an error if any attribute
 is missing or unrecognized, as well as if any sub transformation fails.