Class: Nfe::Reader::Carrier

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

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.



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

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

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



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

def address
  @address
end

#cityObject (readonly)

Returns the value of attribute city.



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

def city
  @city
end

#cnpjObject (readonly)

Returns the value of attribute cnpj.



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

def cnpj
  @cnpj
end

#cpfObject (readonly)

Returns the value of attribute cpf.



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

def cpf
  @cpf
end

#ieObject (readonly)

Returns the value of attribute ie.



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

def ie
  @ie
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#stateObject (readonly)

Returns the value of attribute state.



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

def state
  @state
end