Skip to content

Commit

Permalink
return nil when can't find results
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Paramio committed Feb 25, 2009
1 parent 4065381 commit 6dc273d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.rdoc
Expand Up @@ -56,6 +56,10 @@ but this version supports better usage of matrix and query parameters, uses JSON

# Postal Codes at Algeciras
a.children(:select => "long", :type => 11)

# You can use multiple types on the same query.
# e.g. Country and Province for Algeciras
a.belongtos(:type => [12, 9])

== REQUIREMENTS:

Expand Down
2 changes: 2 additions & 0 deletions lib/geoplanet/place.rb
Expand Up @@ -102,6 +102,8 @@ def get_then_parse(url)
return results['places']['place'].map{|attrs| Place.new attrs} if results['places']
return Place.new(results['place']) if results['place']
nil
rescue
nil
end
end
end
Expand Down

0 comments on commit 6dc273d

Please sign in to comment.