Module: FFaker::AddressMX
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#municipality(st_abbr = nil) ⇒ Object
25
26
27
28
29
|
# File 'lib/ffaker/address_mx.rb', line 25
def municipality(st_abbr = nil)
st_abbr ||= state_abbr
municipalities = Object.const_get("FFaker::AddressMX::#{st_abbr.upcase}")
fetch_sample(municipalities)
end
|
#postal_code ⇒ Object
12
13
14
|
# File 'lib/ffaker/address_mx.rb', line 12
def postal_code
FFaker.numerify('#####')
end
|
#state ⇒ Object
16
17
18
|
# File 'lib/ffaker/address_mx.rb', line 16
def state
fetch_sample(STATE)
end
|
#state_abbr(st_name = nil) ⇒ Object
20
21
22
23
|
# File 'lib/ffaker/address_mx.rb', line 20
def state_abbr(st_name = nil)
st_name ||= state
STATE_ABBR[STATE.index(st_name)]
end
|
#zip_code ⇒ Object
8
9
10
|
# File 'lib/ffaker/address_mx.rb', line 8
def zip_code
FFaker.numerify('#####')
end
|