Class: Cnab240::V86::SegmentoN

Inherits:
BinData::Record show all
Includes:
DefaultMixin, SegmentoMixin
Defined in:
lib/cnab240/segmentos/v86/segmento_n.rb

Instance Attribute Summary

Attributes included from SegmentoMixin

#lote

Instance Method Summary collapse

Methods included from DefaultMixin

#initialize_instance

Methods inherited from BinData::Record

#linha

Instance Method Details

#get_nObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/cnab240/segmentos/v86/segmento_n.rb', line 36

def get_n
  servico_forma_nX = {
    '00' => 0,
    '17' => 1,
    '16' => 2,
    '18' => 3,
    '22' => 4,
    '23' => 4,
    '24' => 4,
    '25' => 5,
    '27' => 6,
    '26' => 7,
    '21' => 8
  }
  begin
    servico_forma = lote.header.servico_forma
  rescue
    servico_forma = '00'
  end
  servico_forma_nX[servico_forma]
end