require 'rubygems'
require 'weary'

class Pat
  def self.get(code)
    (Weary.get "http://www.uk-postcodes.com/postcode/#{code.gsub(' ', '')}.json").perform
  end
end

require 'rubygems'
require 'weary'

class PatClient < Weary::Client
  domain "http://www.uk-postcodes.com"
  
  get :get, "/postcode/{code}.json"
end

def Pat
  def self.get(code)
    PatClient.new.get(:code => code.gsub(' ', '').perform
  end
end

Update for Weary latest version
Update for Weary latest version