1
0
mirror of https://github.com/askn/faker.git synced 2023-08-10 21:13:01 +03:00

add latitude && longitude

This commit is contained in:
Aşkın Gedik 2016-01-05 22:25:13 +02:00
parent 3319563262
commit 6f91a185ab
3 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,9 @@ Faker::Address.state
Faker::Address.state_abbr
Faker::Address.country
Faker::Address.latitude
Faker::Address.longitude
```
### Faker::Company

View File

@ -17,6 +17,9 @@ puts Faker::Address.state
puts Faker::Address.state_abbr
puts Faker::Address.country
puts Faker::Address.latitude
puts Faker::Address.longitude
puts "\n### Faker::Company\n\n"
puts Faker::Company.name

View File

@ -47,5 +47,13 @@ module Faker
->{ "??## #??" },
].sample.call).upcase
end
def self.latitude
((rand * 180) - 90).to_s
end
def self.longitude
((rand * 360) - 180).to_s
end
end
end