Skip to content

Instantly share code, notes, and snippets.

@DanGe42
Created June 4, 2015 03:46
Show Gist options
  • Save DanGe42/debcd895e51893584b3a to your computer and use it in GitHub Desktop.
Save DanGe42/debcd895e51893584b3a to your computer and use it in GitHub Desktop.
def ((defined?(Moped::BSON) ? Moped::BSON : BSON)::ObjectId).legal?(s)
/\A\h{24}\z/ === s.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment