class Laranja::Endereco
Constants
- BAIRRO_PATTERNS
- CIDADES_PATTERNS
- RUA_PATTERNS
Public Class Methods
bairro()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 38 def bairro strf(BAIRRO_PATTERNS.sample) end
cep(ufab = nil)
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 58 def cep(ufab = nil) uf_code(ufab) + strf('#######') end
cep_formatado(ufab = nil)
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 54 def cep_formatado(ufab = nil) uf_code(ufab) + strf('####-###') end
cidade()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 34 def cidade strf(CIDADES_PATTERNS.sample) end
complemento()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 46 def complemento strf('%secondary *###') end
numero()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 50 def numero strf('*###') end
rua()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 42 def rua strf(RUA_PATTERNS.sample) end
uf()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 62 def uf strf('%uf_name') end
uf_sigla()
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 66 def uf_sigla strf('%uf_abbr') end
Private Class Methods
uf_code(ufab)
click to toggle source
# File lib/laranja/generators/pt-BR/endereco.rb, line 72 def uf_code(ufab) if ufab data('codigo_cep')[ufab.to_s.downcase].to_s else strf('#') end end