Skip to content

Instantly share code, notes, and snippets.

@AkihikoITOH
Last active May 21, 2021 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkihikoITOH/8d37ad12d022f4f5220b6f4f30f244ae to your computer and use it in GitHub Desktop.
Save AkihikoITOH/8d37ad12d022f4f5220b6f4f30f244ae to your computer and use it in GitHub Desktop.
class UserFetcher
def call
connection.get("/users/#{user_id}")
end
private
def connection
Faraday.new(url: user_service_base_url) do |faraday|
faraday.request :json
faraday.response :json
faraday.adapter Faraday.default_adapter
faraday.headers.merge!(headers)
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment