Sha256: 6380e085f0495d25d5c67ea9d45094c3e2291bd8f3ced2dce9c7aee3f2bf5ed6

Contents?: true

Size: 574 Bytes

Versions: 5

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

module FFaker
  module AddressMX
    extend ModuleUtils
    extend self

    def zip_code
      FFaker.numerify('#####')
    end

    def postal_code
      FFaker.numerify('#####')
    end

    def state
      fetch_sample(STATE)
    end

    def state_abbr(st_name = nil)
      st_name ||= state
      STATE_ABBR[STATE.index(st_name)]
    end

    def municipality(st_abbr = nil)
      st_abbr ||= state_abbr
      municipalities = Object.const_get("FFaker::AddressMX::#{st_abbr.upcase}")
      fetch_sample(municipalities)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ffaker-2.23.0 lib/ffaker/address_mx.rb
ffaker-2.22.0 lib/ffaker/address_mx.rb
ffaker-2.21.0 lib/ffaker/address_mx.rb
ffaker-2.20.0 lib/ffaker/address_mx.rb
ffaker-2.19.0 lib/ffaker/address_mx.rb