rubocop corrections
This commit is contained in:
1 parent
4b84df0af9
commit
4a7b752ace
4 files changed
+50
-39
No files matched your search
@@ -2,7 +2,6 @@
|
||||
|
||||
module StrikeMe
|
||||
module API
|
||||
|
||||
# Factory helper object connecting the client to the models
|
||||
class Account
|
||||
include BaseClient
|
||||
@@ -16,14 +15,13 @@ module StrikeMe
|
||||
|
||||
url = profile_url
|
||||
response = client.get url
|
||||
#body = response.body.presence
|
||||
#body = JSON.parse(body) if body.is_a? String
|
||||
if response.success?
|
||||
@profile = Profile.new response.body.merge(account: self)
|
||||
else
|
||||
# if you see this, something went wrong, this is test code
|
||||
raise ResponseError.new(url, response.body)
|
||||
end
|
||||
# body = response.body.presence
|
||||
# body = JSON.parse(body) if body.is_a? String
|
||||
raise ResponseError.new(url, response.body) unless response.success?
|
||||
|
||||
@profile = Profile.new response.body.merge(account: self)
|
||||
|
||||
# if you see this, something went wrong, this is test code
|
||||
end
|
||||
|
||||
def profile_url
|
||||
@@ -39,11 +37,9 @@ module StrikeMe
|
||||
return @balances if @balances.present?
|
||||
|
||||
response = client.get 'balances'
|
||||
if response.success?
|
||||
@balances = Balances.new self, response.body
|
||||
else
|
||||
raise ResponseError.new('balances', response.body)
|
||||
end
|
||||
raise ResponseError.new('balances', response.body) unless response.success?
|
||||
|
||||
@balances = Balances.new self, response.body
|
||||
end
|
||||
|
||||
def inspect
|
||||
|
||||
Reference in new issue
Block a user