Class: Synthra::Types::AddressLocation::AirportLatitude
- Defined in:
- lib/synthra/types/address_location/airports.rb
Overview
AirportLatitude type
Instance Method Summary collapse
- #generate_edge(rng, context, args) ⇒ Object
- #generate_invalid(rng, context, args) ⇒ Object
- #generate_random(rng, context, args) ⇒ Object
Instance Method Details
#generate_edge(rng, context, args) ⇒ Object
124 125 126 |
# File 'lib/synthra/types/address_location/airports.rb', line 124 def generate_edge(rng, context, args) [-90.0, 0.0, 90.0].sample(random: rng.instance_variable_get(:@random)) end |
#generate_invalid(rng, context, args) ⇒ Object
128 129 130 |
# File 'lib/synthra/types/address_location/airports.rb', line 128 def generate_invalid(rng, context, args) [nil, "not a number", [], {}].sample(random: rng.instance_variable_get(:@random)) end |
#generate_random(rng, context, args) ⇒ Object
119 120 121 122 |
# File 'lib/synthra/types/address_location/airports.rb', line 119 def generate_random(rng, context, args) # Airport latitudes range from -90 to 90 (rng.rand * 180 - 90).round(6) end |