Initial commit

This commit is contained in:
bterkuile committed 2025-09-15 15:55:58 -05:00
commit 4b5f7906d7
33 files changed
+933

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
# frozen_string_literal: true
module StrikeMe
module API
# The BaseClient module is to be included in objects using the Strike client
# to make calls and transform the responses to objects.
# Factory of BaseModel instances
module BaseClient
extend ActiveSupport::Concern
def client
@client ||= Client.new
end
module ClassMethods
def autoload_default(name)
autoload name, "#{"#{self.name}/#{name}".underscore}.rb"
end
end
# cumbersome, but better for later debugging and handling
class ResponseError
attr_reader :url, :faraday_response
def initialize(url, faraday_response)
@url = url
@faraday_response = faraday_response
end
end
end
end
end