Ruby

The PostalMethods Ruby Gem is published at GitHub and RubyForge.

Unix

  • Make sure you have a working Ruby and gem service and that you have permissions to 'sudo'
  • In 'Terminal', run this command: “sudo gem install postalmethods”

Windows

  • Make sure your path includes the Ruby and gem command
  • Run the following command: "gem install postalmethods"
  • You may use this Installing Ruby in Windows guide

Initiating an instance of the ruby client, with which you can utilize all further actions, is similar in all PostalMethods API commands:

#!/usr/bin/env ruby 
require 'rubygems'
require 'postalmethods'
options = {:username => 'REPLACE', :password => 'THESE'}
client = PostalMethods::Client.new(options)
client.prepare!