module FFaker::AddressNL

Public Instance Methods

city() click to toggle source
# File lib/ffaker/address_nl.rb, line 23
def city
  fetch_sample(CITY)
end
postal_code() click to toggle source
# File lib/ffaker/address_nl.rb, line 10
def postal_code
  FFaker::String.from_regexp(/[1-9]\d{3} [A-RT-Z][A-Z]/)
end
province() click to toggle source
# File lib/ffaker/address_nl.rb, line 27
def province
  fetch_sample(PROVINCE)
end
street_name() click to toggle source
# File lib/ffaker/address_nl.rb, line 18
def street_name
  name = fetch_sample([true, false]) ? NameNL.last_name : NameNL.first_name
  name + random_type_of_street
end
zip_code() click to toggle source
# File lib/ffaker/address_nl.rb, line 14
def zip_code
  postal_code
end

Private Instance Methods

random_type_of_street() click to toggle source
# File lib/ffaker/address_nl.rb, line 33
def random_type_of_street
  case rand(0..19)
  when 0 then 'weg'
  when 1 then 'boulevard'
  when 3 then 'pad'
  when 4 then 'steeg'
  else 'straat'
  end
end