Class: NfeReader::Carrier

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/carrier.rb

Constant Summary

Constants included from AttributeHelper

AttributeHelper::WITHELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributeHelper

#attributes, #attributes_to_hash

Constructor Details

#initialize(attrs = {}) ⇒ Carrier

Returns a new instance of Carrier.



8
9
10
11
12
13
14
15
16
# File 'lib/nfe_reader/carrier.rb', line 8

def initialize(attrs = {})
  @cnpj = attrs[:CNPJ]
  @cpf = attrs[:CPF]
  @name = attrs[:xNome]
  @state_registration = attrs[:IE]
  @address = attrs[:xEnder]
  @city = attrs[:xMun]
  @state = attrs[:UF]
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def address
  @address
end

#cityObject (readonly)

Returns the value of attribute city.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def city
  @city
end

#cnpjObject (readonly)

Returns the value of attribute cnpj.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def cnpj
  @cnpj
end

#cpfObject (readonly)

Returns the value of attribute cpf.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def cpf
  @cpf
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def name
  @name
end

#stateObject (readonly)

Returns the value of attribute state.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def state
  @state
end

#state_registrationObject (readonly)

Returns the value of attribute state_registration.



6
7
8
# File 'lib/nfe_reader/carrier.rb', line 6

def state_registration
  @state_registration
end