class CouncilTaxFinder::Lookup

Constants

API_ENDPOINT

Public Class Methods

new() click to toggle source
# File lib/council_tax_finder/lookup.rb, line 5
def initialize
end

Public Instance Methods

get(postcode:, door: nil, page: 1) click to toggle source
# File lib/council_tax_finder/lookup.rb, line 8
def get(postcode:, door: nil, page: 1)
  @postcode = postcode.gsub(' ', '').downcase
  @door = door
  @page = page
  Oj.load(::Net::HTTP.get(api_endpoint))
rescue Oj::ParseError => ex
  {}
end

Private Instance Methods

api_endpoint() click to toggle source
# File lib/council_tax_finder/lookup.rb, line 19
def api_endpoint
  URI("#{API_ENDPOINT}/#{@postcode}?door=#{@door}&page=#{@page}")
end