Module: PostcodeAnywhere

Includes:
HTTParty
Defined in:
lib/postcode_anywhere.rb,
lib/postcode_anywhere/lookup.rb,
lib/postcode_anywhere/address.rb,
lib/postcode_anywhere/validator.rb,
lib/postcode_anywhere/error_handler.rb

Defined Under Namespace

Classes: Address, ErrorHandler, Lookup, PostcodeAnywhereException, Validator

Constant Summary collapse

SERVICE_ADDRESS =
"http://services.postcodeanywhere.co.uk/PostcodeAnywhere/Interactive/RetrieveByPostcodeAndBuilding/v1.00/xmle.ws"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.keyObject

Returns the value of attribute key.



10
11
12
# File 'lib/postcode_anywhere.rb', line 10

def key
  @key
end

Class Method Details

.find_by_number_and_postcode(number, postcode) ⇒ Object



23
24
25
# File 'lib/postcode_anywhere.rb', line 23

def self.find_by_number_and_postcode(number, postcode)
  lookup(:number => number, :postcode => postcode)
end

.license_keyObject



12
13
14
# File 'lib/postcode_anywhere.rb', line 12

def license_key
  @key
end

.lookup(options = {}) ⇒ Object



17
18
19
20
21
# File 'lib/postcode_anywhere.rb', line 17

def self.lookup(options = {})
  validate_key
  validate_postcode(options[:postcode])
  return find_postcode(options)
end