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
# File 'lib/models/client.rb', line 7

def initialize(options = {})
  @cpf = options[:cpf]
  @name = options[: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



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

def to_hash
  {
    cpf: @cpf,
    nome_completo: @name,
    endereco: @address,
    complemento: @complement,
    numero: @number,
    bairro: @neighborhood,
    cidade: @city,
    uf: @uf,
    cep: @cep,
    phone: @phone,
    email: @mail
  }
end