Skip to content

Instantly share code, notes, and snippets.

@monorkin
Created December 23, 2018 14:06
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 monorkin/6e9f8af6d848872347f2fffde39d84ec to your computer and use it in GitHub Desktop.
Save monorkin/6e9f8af6d848872347f2fffde39d84ec to your computer and use it in GitHub Desktop.
class MyAppApiClient
attr_reader :json_client
attr_reader :xml_client
def initialize(api_token)
@json_client = ApiClient.new(API_KEY, JSON.method(:parse).to_proc)
@xml_client = ApiClient.new(API_KEY, XML.method(:parse).to_proc)
end
def current_account
json_client.get('/api/current_account')
end
def balance
xml_client.get('/api/current_account/balance')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment