Module: Dummy::Address
Instance Method Summary collapse
- #city ⇒ Object
- #neighborhood ⇒ Object
- #street_address ⇒ Object
- #street_name ⇒ Object
- #us_state ⇒ Object
- #us_state_short ⇒ Object
- #zip_code ⇒ Object
Instance Method Details
#city ⇒ Object
17 18 19 |
# File 'lib/dummy/address.rb', line 17 def city CITIES.rand end |
#neighborhood ⇒ Object
34 35 36 |
# File 'lib/dummy/address.rb', line 34 def neighborhood NEIGHBORHOOD.rand end |
#street_address ⇒ Object
28 29 30 31 32 |
# File 'lib/dummy/address.rb', line 28 def street_address str = ("#" * rand(3)) << "### #{street_name}" str.numerify end |
#street_name ⇒ Object
21 22 23 24 25 26 |
# File 'lib/dummy/address.rb', line 21 def street_name case rand(2) when 0 then "#{Name.last_name} #{street_suffix}" when 1 then "#{Name.first_name} #{street_suffix}" end end |
#us_state ⇒ Object
9 10 11 |
# File 'lib/dummy/address.rb', line 9 def us_state STATE.rand end |
#us_state_short ⇒ Object
13 14 15 |
# File 'lib/dummy/address.rb', line 13 def us_state_short STATE_ABBR.rand end |
#zip_code ⇒ Object
5 6 7 |
# File 'lib/dummy/address.rb', line 5 def zip_code ZIP_FORMATS.rand.numerify end |