Class: Faker::Address

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

Constant Summary

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary (collapse)

Methods inherited from Base

bothify, fetch, flexible, letterify, method_missing, numerify, parse, regexify, translate

Class Method Details

+ (Object) building_number



22
23
24
# File 'lib/faker/address.rb', line 22

def building_number
  bothify(fetch('address.building_number'))
end

+ (Object) city



6
7
8
# File 'lib/faker/address.rb', line 6

def city
  parse('address.city')
end

+ (Object) city_prefix



39
# File 'lib/faker/address.rb', line 39

def city_prefix;   fetch('address.city_prefix');   end

+ (Object) city_suffix



38
# File 'lib/faker/address.rb', line 38

def city_suffix;   fetch('address.city_suffix');   end

+ (Object) country



42
# File 'lib/faker/address.rb', line 42

def country;       fetch('address.country');       end

+ (Object) latitude



44
45
46
# File 'lib/faker/address.rb', line 44

def latitude
  ((rand * 180) - 90).to_s
end

+ (Object) longitude



48
49
50
# File 'lib/faker/address.rb', line 48

def longitude
  ((rand * 360) - 180).to_s
end

+ (Object) secondary_address



18
19
20
# File 'lib/faker/address.rb', line 18

def secondary_address
  numerify(fetch('address.secondary_address'))
end

+ (Object) state



41
# File 'lib/faker/address.rb', line 41

def state;         fetch('address.state');         end

+ (Object) state_abbr



40
# File 'lib/faker/address.rb', line 40

def state_abbr;    fetch('address.state_abbr');    end

+ (Object) street_address(include_secondary = false)



14
15
16
# File 'lib/faker/address.rb', line 14

def street_address(include_secondary = false)
  numerify(parse('address.street_address') + (include_secondary ? ' ' + secondary_address : ''))
end

+ (Object) street_name



10
11
12
# File 'lib/faker/address.rb', line 10

def street_name
  parse('address.street_name')
end

+ (Object) street_suffix



37
# File 'lib/faker/address.rb', line 37

def street_suffix; fetch('address.street_suffix'); end

+ (Object) time_zone



30
31
32
# File 'lib/faker/address.rb', line 30

def time_zone
  bothify(fetch('address.time_zone'))
end

+ (Object) zip_code Also known as: zip, postcode



26
27
28
# File 'lib/faker/address.rb', line 26

def zip_code
  bothify(fetch('address.postcode'))
end