class Segurofacil::Estagiario

Constants

BIRTHDATE
CPF
FEMALE
GENDER
MALE
NAME

Attributes

birthdate[R]
cpf[R]
gender[R]
name[R]

Public Class Methods

ary_to_estagiarios(list) click to toggle source
# File lib/segurofacil/estagiario.rb, line 52
def ary_to_estagiarios(list)
  return [] if list.nil?
  list.map {|item| convert_to_estagiario(item) }
end
convert_to_estagiario(hash) click to toggle source
# File lib/segurofacil/estagiario.rb, line 48
def convert_to_estagiario(hash)
  self.new hash
end
create(estagiario, cnpj) click to toggle source
Calls superclass method
# File lib/segurofacil/estagiario.rb, line 34
def create(estagiario, cnpj)
  res = super estagiario, cnpj
  get_create_response(res)
end
new(options) click to toggle source
# File lib/segurofacil/estagiario.rb, line 17
def initialize(options)
  @name      = options.fetch(NAME)
  @cpf       = options.fetch(CPF)
  @birthdate = options.fetch(BIRTHDATE)
  @gender    = options.fetch(GENDER)
end
remove(estagiario_cpf, cnpj) click to toggle source

Remove a estagiario from the policy @param estagiario_cpf [String] the estagiario to be removed @param cnpj [String] the cnpj of the company that holds the estagiario’s policy @return EstagiarioRemoveResponse

Calls superclass method
# File lib/segurofacil/estagiario.rb, line 43
def remove(estagiario_cpf, cnpj)
  res = super estagiario_cpf, cnpj
  get_remove_response(res)
end

Private Class Methods

get_create_response(res) click to toggle source
# File lib/segurofacil/estagiario.rb, line 59
def get_create_response(res)
  Segurofacil::Responses::EstagiarioCreateResponse.new(res)
end
get_remove_response(res) click to toggle source
# File lib/segurofacil/estagiario.rb, line 63
def get_remove_response(res)
  Segurofacil::Responses::EstagiarioRemoveResponse.new(res)
end

Public Instance Methods

female?() click to toggle source
# File lib/segurofacil/estagiario.rb, line 28
def female?
  gender == FEMALE
end
male?() click to toggle source
# File lib/segurofacil/estagiario.rb, line 24
def male?
  gender == MALE
end