Class: Segurofacil::Apolice

Inherits:
Object
  • Object
show all
Extended by:
REST::ApoliceCancel, REST::ApoliceCreate
Defined in:
lib/segurofacil/apolice.rb

Constant Summary

Constants included from REST::ApoliceCreate

REST::ApoliceCreate::PATH

Constants included from REST::ApoliceCancel

REST::ApoliceCancel::PATH

Class Method Summary collapse

Methods included from REST::ApoliceCreate

create

Methods included from REST::ApoliceCancel

cancel

Class Method Details

.cancel(cnpj) ⇒ Object



35
36
37
38
# File 'lib/segurofacil/apolice.rb', line 35

def cancel(cnpj)
  res = super cnpj
  get_cancel_response(res)
end

.create(company) ⇒ ApoliceCreateResponse

Create a new insurance policy

Examples:

Create new policy

Segurofacil::Apolice.create({
  name: "Company Test",
  razaoSocial: "Company Test",
  cNPJ: "33.333.333/0001-33",
  responsavel: "Test",
  cPF: "333.333.333-33",
  qualificacao: "Test",
  email: "[email protected]",
  telefone: "35555555",
  atividade: "Test",
  address1: "Test",
  address2: "Test",
  bairro: "Manhattan",
  city: "NYC",
  estado: "NY",
  cep: "12345678"
})

Parameters:

  • company (Hash)

    the new insurance holder

Returns:

  • (ApoliceCreateResponse)


30
31
32
33
# File 'lib/segurofacil/apolice.rb', line 30

def create(company)
  res = super company
  get_create_response(res)
end