Skip to content

Commit

Permalink
update NullVersion to raise on new ApiVersion methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jtgrenz committed Sep 3, 2019
1 parent adaf51e commit 0ee8d7e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/shopify_api/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,22 @@ def handle_as_date

class NullVersion
class << self
def stable?
raise ApiVersionNotSetError, "You must set ShopifyAPI::Base.api_version before making a request."
end

def construct_api_path(*_path)
raise ApiVersionNotSetError, "You must set ShopifyAPI::Base.api_version before making a request."
end

def construct_graphql_path
def raise_not_set_error(*_args)
raise ApiVersionNotSetError, "You must set ShopifyAPI::Base.api_version before making a request."
end
alias_method :stable?, :raise_not_set_error
alias_method :construct_api_path, :raise_not_set_error
alias_method :construct_graphql_path, :raise_not_set_error
alias_method :latest_supported?, :raise_not_set_error
alias_method :supported?, :raise_not_set_error
alias_method :verified?, :raise_not_set_error
alias_method :unstable?, :raise_not_set_error
alias_method :handle, :raise_not_set_error
alias_method :display_name, :raise_not_set_error
alias_method :supported, :raise_not_set_error
alias_method :verified, :raise_not_set_error
alias_method :latest_supported, :raise_not_set_error
alias_method :name, :raise_not_set_error
end
end
end
Expand Down

0 comments on commit 0ee8d7e

Please sign in to comment.