Design updates with error handling
This commit is contained in:
1 parent
4c73608549
commit
4b84df0af9
9 files changed
+124
-38
No files matched your search
@@ -3,9 +3,7 @@
|
||||
module StrikeMe
|
||||
module API
|
||||
class Client
|
||||
attr_reader :version, :connection
|
||||
|
||||
delegate :get, to: :connection
|
||||
attr_reader :version, :connection, :last_response
|
||||
|
||||
def initialize(**args)
|
||||
@version = args[:version] || 'v1'
|
||||
@@ -23,6 +21,11 @@ module StrikeMe
|
||||
builder.response :json
|
||||
end
|
||||
end
|
||||
|
||||
#delegate :get, to: :connection
|
||||
def get(...)
|
||||
@last_response = connection.get(...)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user