Sha256: c9c8a23567c8e539d1ec1b6e589efc5af91e2f8202425ba9a193f2e67eb44585

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

# frozen_string_literal: true

module FFakerTW
  module AddressIT
    extend ModuleUtils
    extend self

    NUM = ['#', '##', '##', '###', '####', '#-##'].freeze
    SEP = [', ', ' '].freeze
    TYPE = %w[via viale piazza piazzale].freeze
    POSTAL_CODE_FORMATS = ['#####'].freeze

    def street_address
      FFakerTW.numerify(fetch_sample(NUM)) +
        fetch_sample(SEP) +
        fetch_sample(TYPE) + ' ' +
        FFakerTW::NameIT.name
    end

    def postal_code
      FFakerTW.numerify(fetch_sample(POSTAL_CODE_FORMATS))
    end

    def city
      fetch_sample(CITY)
    end

    def full_address
      %(#{street_address}#{fetch_sample(SEP)}#{postal_code} #{fetch_sample(CITY)})
    end

    def region
      fetch_sample(REGION)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffakerTW-0.1.0 lib/ffakerTW/address_it.rb