app/models/api/base_api.rb in api_versioning-0.0.1 vs app/models/api/base_api.rb in api_versioning-0.0.2
- old
+ new
@@ -1,11 +1,17 @@
class Api::BaseApi
attr_accessor :api_version
-
+ attr_accessor :request
+
API_VERSION_REGEX = /v[0-9]+(_[0-9]+)*/i
- def initialize(version=nil)
+ def xx
+ "xx"
+ end
+
+ def initialize(version=nil, request=nil)
+ self.request = request
set_api_version(version)
end
def render(data)
respond_to?(api_version) ? self.send(api_version, data) : nil
\ No newline at end of file