def to_hash(retain_references=false)
      if retain_references then
        canton        = @canton
        agglomeration = @agglomeration
      else
        canton        = @canton && @canton.license_tag
        agglomeration = @agglomeration && @agglomeration.community_number
      end

      {
        :community_number => @community_number,
        :name             => @name,
        :canton           => canton,
        :agglomeration    => agglomeration,
      }
    end
def to_hash(retain_references=false)
      if retain_references then
        canton        = @canton
        agglomeration = @agglomeration
      else
        canton        = @canton && @canton.license_tag
        agglomeration = @agglomeration && @agglomeration.community_number
      end

      {
        :community_number => @community_number,
        :name             => @name,
        :canton           => canton,
        :agglomeration    => agglomeration,
      }
    end
@param [Boolean] retain_references
   If set to false, :agglomeration will be set to the community_number and
   :canton to the canton's license_tag.

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