Module: Dummy::Address

Extended by:
Address
Included in:
Address
Defined in:
lib/dummy/address.rb

Instance Method Summary collapse

Instance Method Details

#cityObject



17
18
19
# File 'lib/dummy/address.rb', line 17

def city
  CITIES.rand
end

#neighborhoodObject



34
35
36
# File 'lib/dummy/address.rb', line 34

def neighborhood
  NEIGHBORHOOD.rand
end

#street_addressObject



28
29
30
31
32
# File 'lib/dummy/address.rb', line 28

def street_address
  str = ("#" * rand(3)) << "### #{street_name}"

  str.numerify
end

#street_nameObject



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_stateObject



9
10
11
# File 'lib/dummy/address.rb', line 9

def us_state
  STATE.rand
end

#us_state_shortObject



13
14
15
# File 'lib/dummy/address.rb', line 13

def us_state_short
  STATE_ABBR.rand
end

#zip_codeObject



5
6
7
# File 'lib/dummy/address.rb', line 5

def zip_code
  ZIP_FORMATS.rand.numerify
end