Class: TextGen::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/textgen/address.rb

Constant Summary collapse

@@st_parts =
['ave','circle','blvd','rd','st','ln','way','pl','ct','pkwy','alley']

Class Method Summary collapse

Class Method Details

.cityObject



12
13
14
# File 'lib/textgen/address.rb', line 12

def self.city
  "Fake City"
end

.generateObject

todo: just enable from geocoding?



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

def self.generate #todo: just enable from geocoding?
  "#{street}, #{city} #{state} #{postal}"
end

.postalObject



18
19
20
21
22
# File 'lib/textgen/address.rb', line 18

def self.postal
  return 5.times.collect do 
    rand(0..9).to_s
  end.join
end

.stateObject



15
16
17
# File 'lib/textgen/address.rb', line 15

def self.state
  "ST"
end

.streetObject

todo, just use trees/nature and people?



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

def self.street ##todo, just use trees/nature and people?
  "#{rand(1..9999)} #{TextGen::Noun.pick.capitalize} #{@@st_parts.sample.capitalize}"
end