From: Intransition Date: 2012-07-31T06:54:55+09:00 Subject: Supporting multiple versions of an API ------=_Part_753_13154662.1343685292333 Content-Type: multipart/alternative; boundary="----=_Part_754_263443.1343685292333" ------=_Part_754_263443.1343685292333 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Any recommendations on the management of API versions. I have a case in which it is important that my library support all versions. For example, currently I am basically doing: module MyLib module V0 module Main ... end end class Main def initialize(version) extend MyLib.const_get("V#{version}")::Main end end end Does that seem like a good approach. Or is it overkill? Is there a better way to handle this? Thanks. ------=_Part_754_263443.1343685292333 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Any recommendations on the management of API versions. I have a case in which it is important that my library support all versions.

For example, currently I am basically doing:

  module MyLib
    module V0
      module Main
        ...
      end
    end

    class Main
      def initialize(version)
        extend MyLib.const_get("V#{version}")::Main
      end
    end
  end

Does that seem like a good approach. Or is it overkill? Is there a better way to handle this?

Thanks.
------=_Part_754_263443.1343685292333-- ------=_Part_753_13154662.1343685292333--