Module: Brval::CepCall

Included in:
Brval
Defined in:
lib/brval/cep_call.rb

Instance Method Summary collapse

Instance Method Details

#cep_info(cep) ⇒ Object



9
10
11
12
13
# File 'lib/brval/cep_call.rb', line 9

def cep_info(cep)
  cep = cep.to_s.tr('^0-9', '')
  return false if cep.nil? || cep.length > 8
  call_apis_info(cep)
end

#cep_valid?(cep) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
# File 'lib/brval/cep_call.rb', line 3

def cep_valid?(cep)
  cep = cep.to_s.tr('^0-9', '')
  return false if cep.nil? || cep.length > 8
  call_apis_check(cep)
end