Class: Teodoro::Leiaute::ArquivoS2200::LeiauteSimplificado

Inherits:
Object
  • Object
show all
Includes:
Leiaute
Defined in:
lib/teodoro/leiaute/arquivo_s2200.rb

Instance Method Summary collapse

Methods included from Leiaute

#[]

Instance Method Details

#categoria_do_trabalhadorObject



433
434
435
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 433

def categoria_do_trabalhador
  evento['vinculo/infoContrato/codCateg']
end

#condicao_de_ingresso_no_brasil_do_trabalhadorObject



407
408
409
410
411
412
413
414
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 407

def condicao_de_ingresso_no_brasil_do_trabalhador
  @condicao_de_ingresso_no_brasil_do_trabalhador ||=
    evento['trabalhador/trabImig']&.then do |imigrante|
      Teodoro::LeiauteSimplificado::TrabalhadorImigrante
        .new(imigrante)
        .condicao_de_ingresso_no_brasil_no_leiaute2
    end
end

#data_de_admissaoObject



425
426
427
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 425

def data_de_admissao
  evento['vinculo/infoRegimeTrab/infoCeletista/dtAdm']
end

#data_de_opcao_pelo_fgtsObject



437
438
439
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 437

def data_de_opcao_pelo_fgts
  @data_de_opcao_pelo_fgts ||= evento['vinculo/infoRegimeTrab/infoCeletista/FGTS/dtOpcFGTS']
end

#empregado_domestico?Boolean

Returns:

  • (Boolean)


429
430
431
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 429

def empregado_domestico?
  categoria_do_trabalhador == '104'
end

#opcao_pelo_fgtsObject



416
417
418
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 416

def opcao_pelo_fgts
  @opcao_pelo_fgts ||= optante_pelo_fgts? ? 1 : 2
end

#optante_pelo_fgts?Boolean

Returns:

  • (Boolean)


420
421
422
423
# File 'lib/teodoro/leiaute/arquivo_s2200.rb', line 420

def optante_pelo_fgts?
  data_de_admissao >= (empregado_domestico? ? '2015-10-01' : '1988-10-05') ||
    evento['vinculo/infoRegimeTrab/infoCeletista/FGTS']
end