Class: WebmaniabrNfeRuby::Models::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/models/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/models/client.rb', line 7

def initialize(options = {})
  @cpf          = options[:cpf]
  @name         = options[:name]
  @cnpj         = options[:cnpj]
  @ie           = options[:ie]
  @company_name = options[:company_name]
  @suframa      = options[:suframa]
  @id_foreign   = options[:id_foreign]
  @foreign_name = options[:foreign_name]
  @cod_country  = options[:cod_country]
  @country_name = options[:country_name]
  @address      = options[:address]
  @complement   = options[:complement]
  @number       = options[:number]
  @neighborhood = options[:neighborhood]
  @city         = options[:city]
  @uf           = options[:uf]
  @cep          = options[:cep]
  @phone        = options[:phone]
  @mail         = options[:mail]
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/models/client.rb', line 4

def address
  @address
end

#cepObject

Returns the value of attribute cep.



4
5
6
# File 'lib/models/client.rb', line 4

def cep
  @cep
end

#cityObject

Returns the value of attribute city.



4
5
6
# File 'lib/models/client.rb', line 4

def city
  @city
end

#complementObject

Returns the value of attribute complement.



4
5
6
# File 'lib/models/client.rb', line 4

def complement
  @complement
end

#cpfObject

Returns the value of attribute cpf.



4
5
6
# File 'lib/models/client.rb', line 4

def cpf
  @cpf
end

#mailObject

Returns the value of attribute mail.



4
5
6
# File 'lib/models/client.rb', line 4

def mail
  @mail
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/models/client.rb', line 4

def name
  @name
end

#neighborhoodObject

Returns the value of attribute neighborhood.



4
5
6
# File 'lib/models/client.rb', line 4

def neighborhood
  @neighborhood
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/models/client.rb', line 4

def number
  @number
end

#phoneObject

Returns the value of attribute phone.



4
5
6
# File 'lib/models/client.rb', line 4

def phone
  @phone
end

#ufObject

Returns the value of attribute uf.



4
5
6
# File 'lib/models/client.rb', line 4

def uf
  @uf
end

Instance Method Details

#to_hashObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/models/client.rb', line 29

def to_hash
  {
    cpf: @cpf,
    nome_completo: @name,
    cnpj: @cnpj,
    ie: @ie,
    razao_social: @company_name,
    suframa: @suframa,
    id_estrangeiro: @id_foreign,
    nome_estrangeiro: @foreign_name,
    cod_pais: @cod_country,
    nome_pais: @country_name,
    endereco: @address,
    complemento: @complement,
    numero: @number,
    bairro: @neighborhood,
    cidade: @city,
    uf: @uf,
    cep: @cep,
    phone: @phone,
    email: @mail
  }
end