def to_hash(retain_references=false)
      delivery_by       = retain_references ? @delivery_by : (@delivery_by && @delivery_by.ordering_number)
      largest_community = retain_references ? @largest_community : (@largest_community && @largest_community.community_number)
      communities       = retain_references ? @communities : @communities.map(&:community_number)
      canton            = retain_references ? @canton : (@canton && @canton.license_tag)
      {
        :ordering_number      => @ordering_number,
        :type                 => @type,
        :code                 => @code,
        :add_on               => @add_on,
        :name                 => @name,
        :name_short           => @name_short,
        :canton               => canton,
        :language             => @language,
        :language_alternative => @language_alternative,
        :sortfile_member      => @sortfile_member,
        :delivery_by          => delivery_by,
        :largest_community    => largest_community,
        :communities          => communities,
        :valid_from           => @valid_from,
        :valid_until          => @valid_until,
      }
    end
def to_hash(retain_references=false)
      delivery_by       = retain_references ? @delivery_by : (@delivery_by && @delivery_by.ordering_number)
      largest_community = retain_references ? @largest_community : (@largest_community && @largest_community.community_number)
      communities       = retain_references ? @communities : @communities.map(&:community_number)
      canton            = retain_references ? @canton : (@canton && @canton.license_tag)
      {
        :ordering_number      => @ordering_number,
        :type                 => @type,
        :code                 => @code,
        :add_on               => @add_on,
        :name                 => @name,
        :name_short           => @name_short,
        :canton               => canton,
        :language             => @language,
        :language_alternative => @language_alternative,
        :sortfile_member      => @sortfile_member,
        :delivery_by          => delivery_by,
        :largest_community    => largest_community,
        :communities          => communities,
        :valid_from           => @valid_from,
        :valid_until          => @valid_until,
      }
    end
@param [Boolean] retain_references
   If set to false, :delivery_by will be set to the ordering number,
   :largest_community to the community_number, :communities to their respective
   community numbers and :canton to the canton's license_tag.

 @return [Hash]
   All properties of the zip code as a hash.