Sha256: d01d1aeb9084eb4f23991a9d37be70f4c4db9fa0f69217cd4af292c97ff78dbe

Contents?: true

Size: 300 Bytes

Versions: 1

Compression:

Stored size: 300 Bytes

Contents

require "mapitpostcode/version"
require "open-uri"
require "json"

module MapitPostcode
  BASE_URL = "http://mapit.mysociety.org/postcode/"
  # Your code goes here...
  def self.get(postcode)
    postcode.downcase!
    postcode.gsub!(" ", "")
    JSON.parse(open(BASE_URL + postcode).read)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mapitpostcode-0.0.1 lib/mapitpostcode.rb