Last active
March 31, 2020 05:41
-
-
Save agungsetiawan/0c821c2a00e1f1615fd12323b5a06e70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Connection | |
def self.internal_api(*args) | |
self.faraday(*args) do |f| | |
f.headers['Content-Type'] = 'application/json' | |
f.headers['InternalAPIPassword'] = ENV['INTERNAL_API_PASSWORD'] | |
f.headers['UserRole'] = ENV['USER_ROLE'] | |
f.headers['UserCode'] = ENV['USER_CODE'] | |
end | |
end | |
def self.faraday(*args) | |
Faraday.new(*args) do |f| | |
yield(f) if block_given? | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment