def add(relation, item)
      unless item.respond_to?(:to_hash)
        raise ArgumentError.new('only items that can be converted to hashes with #to_hash are permitted')
      end

      @relations[relation] = @relations.fetch(relation, []) << item
    end
def add(relation, item)
      unless item.respond_to?(:to_hash)
        raise ArgumentError.new('only items that can be converted to hashes with #to_hash are permitted')
      end

      @relations[relation] = @relations.fetch(relation, []) << item
    end
Adds an object to a relation.

 @example
     relations = RelationMap.new
     relations.add 'self', Link.new('/resource/1')
     relations['self']
     # => [#<Halibut::Core::Link:0x007fa0ca5b92b8 @href=\"/resource/1\",
          @options=#<Halibut::Core::Link::Options:0x007fa0ca5b9240
          @templated=nil, @type=nil, @name=nil, @profile=nil,
          @title=nil, @hreflang=nil>>]

 @param [String] relation relation that the object belongs to
 @param [Object] item     the object to add to the relation