Skip to content

Instantly share code, notes, and snippets.

@AkihikoITOH
Created May 21, 2021 09:41
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/fd874a5f2830c11cd4ad0191f79bcdab to your computer and use it in GitHub Desktop.
Save AkihikoITOH/fd874a5f2830c11cd4ad0191f79bcdab to your computer and use it in GitHub Desktop.
class UserService::Api::UserFetcher < ::NxtClients::Client
configure do |config|
config.base_url = user_service_base_url
config.request_options.deep_merge!(headers: headers)
end
def call
fire("/users/#{user_id}") do |response_handler|
response_handler.on(:success) do |response|
json = JSON(response.body)
UserService::User.new(json)
end
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment