lib/abn/client.rb
# Performs an ABR search for the ABN setup upon initialization
#
# @param [String] abn - the abn you wish to search for
# @return [Hash] search result in a hash
Performs an ABR search for the ABN setup upon initialization
Performs an ABR search for the ABN setup upon initialization
def search(abn)
      self.errors << "No ABN provided." && return if abn.nil?
      self.errors << "No GUID provided. Please obtain one at - #{WEBSERVICES_URL}" && return if self.guid.nil?
      begin
        response = ::HTTParty.get(JSON_API_URL, query: { abn: abn.gsub(" ", ""), guid: guid })
        result = JSON.parse(response[9..-2], symbolize_names: true)
        json_parse_search_result(result)
      rescue => ex
        self.errors << ex.to_s
      end
    end
def search ( abn ) self . errors << "No ABN provided." && return if abn . nil? self . errors << "No GUID provided. Please obtain one at - #{WEBSERVICES_URL}" && return if self . guid . nil? begin response = :: HTTParty . get ( JSON_API_URL , query : { abn : abn . gsub ( " " , "" ) , guid : guid } ) result = JSON . parse ( response [ 9 .. - 2 ] , symbolize_names : true ) json_parse_search_result ( result ) rescue => ex self . errors << ex . to_s end end
Performs an ABR search for the ABN setup upon initialization
Performs an ABR search for the ABN setup upon initialization
search result in a hash
search result in a hash
Hash
abn
<not_specific>
<not_specific>
the abn you wish to search for
the abn you wish to search for