|
@@ -3,7 +3,6 @@ require 'shopify_api/version'
|
|
|
module ShopifyAPI
|
|
|
class Base < ActiveResource::Base
|
|
|
class InvalidSessionError < StandardError; end
|
|
|
- class ApiVersionNotSetError < StandardError; end
|
|
|
extend Countable
|
|
|
|
|
|
self.timeout = 90
|
|
@@ -59,17 +58,17 @@ module ShopifyAPI
|
|
|
end
|
|
|
|
|
|
def api_version
|
|
|
- api_version = if _api_version_defined?
|
|
|
+ if _api_version_defined?
|
|
|
_api_version
|
|
|
elsif superclass != Object && superclass.site
|
|
|
superclass.api_version.dup.freeze
|
|
|
+ else
|
|
|
+ ApiVersion::NullVersion
|
|
|
end
|
|
|
- raise ApiVersionNotSetError, "You must set ShopifyAPI::Base.api_version before making a request." unless api_version
|
|
|
- api_version
|
|
|
end
|
|
|
|
|
|
def api_version=(version)
|
|
|
- self._api_version = version.nil? ? nil : ApiVersion.coerce_to_version(version)
|
|
|
+ self._api_version = version.nil? ? ApiVersion::NullVersion : ApiVersion.coerce_to_version(version)
|
|
|
end
|
|
|
|
|
|
def prefix(options = {})
|