Sha256: a72657cc659a76c31ec3b6f3df54bd7a7413772d89170a1041c40b5bf41f0deb

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

module Assertiva
  class Localize
    def self.paths
      paths = {
        by_cpf: "/v1/localize/1000/consultar",
        by_cnpj: "/v1/localize/1001/consultar",
        by_phone: "/v1/localize/1002/consultar",
        by_email: "/v1/localize/1003/consultar",
        by_name_or_address: "/v1/localize/1004/consultar",
        related_by_cpf: "/v1/localize/1005/consultar"
      }
    end

    def self.query_by_cpf(cpf)
      begin
        Requests.post(self.paths[:by_cpf] + "?cpf=#{cpf}")
      rescue => e
        raise
      end
    end

    def self.query_by_name_or_address(query_params)
      begin
        Requests.post(self.paths[:by_name_or_address], query_params)
      rescue => e
        raise
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assertiva-0.2.1 lib/assertiva/localize.rb