Class: TinyErpApi::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/tiny_erp_api/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endereco:, uf:, endereco_numero: nil, complemento: nil, bairro: nil, municipio: nil, cep: nil, fone: nil, nome_destinatario: nil, cpf_cnpj: nil, tipo_pessoa: nil, ie: nil) ⇒ Address

Returns a new instance of Address.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/tiny_erp_api/address.rb', line 5

def initialize(endereco:, uf:, endereco_numero: nil, complemento: nil, bairro: nil, municipio: nil, cep: nil, fone: nil, nome_destinatario: nil, cpf_cnpj: nil, tipo_pessoa: nil, ie: nil)
  @endereco = endereco
  @endereco_numero = endereco_numero
  @complemento = complemento
  @bairro = bairro
  @municipio = municipio
  @cep = cep
  @uf = uf
  @fone = fone
  @nome_destinatario = nome_destinatario
  @cpf_cnpj = cpf_cnpj
  @tipo_pessoa = tipo_pessoa
  @ie = ie
end

Instance Attribute Details

#bairroObject (readonly)

Returns the value of attribute bairro.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def bairro
  @bairro
end

#cepObject (readonly)

Returns the value of attribute cep.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def cep
  @cep
end

#complementoObject (readonly)

Returns the value of attribute complemento.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def complemento
  @complemento
end

#cpf_cnpjObject (readonly)

Returns the value of attribute cpf_cnpj.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def cpf_cnpj
  @cpf_cnpj
end

#enderecoObject (readonly)

Returns the value of attribute endereco.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def endereco
  @endereco
end

#endereco_numeroObject (readonly)

Returns the value of attribute endereco_numero.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def endereco_numero
  @endereco_numero
end

#foneObject (readonly)

Returns the value of attribute fone.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def fone
  @fone
end

#ieObject (readonly)

Returns the value of attribute ie.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def ie
  @ie
end

#municipioObject (readonly)

Returns the value of attribute municipio.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def municipio
  @municipio
end

#nome_destinatarioObject (readonly)

Returns the value of attribute nome_destinatario.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def nome_destinatario
  @nome_destinatario
end

#tipo_pessoaObject (readonly)

Returns the value of attribute tipo_pessoa.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def tipo_pessoa
  @tipo_pessoa
end

#ufObject (readonly)

Returns the value of attribute uf.



4
5
6
# File 'lib/tiny_erp_api/address.rb', line 4

def uf
  @uf
end

Instance Method Details

#to_api_hashObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/tiny_erp_api/address.rb', line 20

def to_api_hash
  {
    endereco: endereco,
    enderecoNro: endereco_numero,
    complemento: complemento,
    bairro: bairro,
    municipio: municipio,
    cep: cep,
    uf: uf,
    fone: fone,
    nomeDestinatario: nome_destinatario,
    cpfCnpj: cpf_cnpj,
    tipoPessoa: tipo_pessoa,
    ie: ie
  }
end