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:
parent
3319563262
commit
6f91a185ab
@ -39,6 +39,9 @@ Faker::Address.state
|
|||||||
Faker::Address.state_abbr
|
Faker::Address.state_abbr
|
||||||
Faker::Address.country
|
Faker::Address.country
|
||||||
|
|
||||||
|
Faker::Address.latitude
|
||||||
|
Faker::Address.longitude
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Faker::Company
|
### Faker::Company
|
||||||
|
@ -17,6 +17,9 @@ puts Faker::Address.state
|
|||||||
puts Faker::Address.state_abbr
|
puts Faker::Address.state_abbr
|
||||||
puts Faker::Address.country
|
puts Faker::Address.country
|
||||||
|
|
||||||
|
puts Faker::Address.latitude
|
||||||
|
puts Faker::Address.longitude
|
||||||
|
|
||||||
puts "\n### Faker::Company\n\n"
|
puts "\n### Faker::Company\n\n"
|
||||||
|
|
||||||
puts Faker::Company.name
|
puts Faker::Company.name
|
||||||
|
@ -47,5 +47,13 @@ module Faker
|
|||||||
->{ "??## #??" },
|
->{ "??## #??" },
|
||||||
].sample.call).upcase
|
].sample.call).upcase
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.latitude
|
||||||
|
((rand * 180) - 90).to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.longitude
|
||||||
|
((rand * 360) - 180).to_s
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user