Created
September 6, 2011 03:16
-
-
Save bensonk/1196498 to your computer and use it in GitHub Desktop.
Coordinate auto-splitting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Search < MongoObject | |
def coords=(x) | |
if String === x | |
super(x.split(",")) | |
else | |
super(x) | |
end | |
end | |
end | |
stuff.coords = "54, 234" | |
stuff.coords = [45, 23] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment