Search code examples
ruby-on-railsrubyruby-on-rails-3google-geocoder

Complex if condition with parameters


if @near.nil?
  loc, @near, found = get_user_geolocation
else
  loc = GeoKit::Geocoders::GoogleGeocoder.geocode(@near)
  found = loc.success
  @near = loc.full_address
end

In the first if part, what is going on? I may be not good with syntax, but it made me curious. Thanks in advance.


Solution

  • The get_user_geolocation method returns three values: loc, @near and found.