Skip to content

Instantly share code, notes, and snippets.

@HHRy
Created January 20, 2011 22:00
Show Gist options
  • Save HHRy/788774 to your computer and use it in GitHub Desktop.
Save HHRy/788774 to your computer and use it in GitHub Desktop.
# GemAgent API Interface
# Ryan Stenhouse, 20 January 2011
# Longhand representation of connecting to the FreeAgent API
#
ga = GemAgent::NetHttpConnection.new 'you.freeagentcentral.com', GemAgent::HttpBasicAuthentication.new('username','password')
ga.verify # => { :user_id => 1, :permission_level => 8, :company_type => UK_LIMITED }
# Sexy sugary version of the above.
#
GemAgent::Api.connect 'you.freeagentcentral.com', 'username', 'password' do |api|
api.verify # => { :user_id => 1, :permission_level => 8, :company_type => UK_LIMITED }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment