From b8fcd28c51e759f5c4b88b76abcb19999306f76a Mon Sep 17 00:00:00 2001 From: Jim Menard Date: Wed, 14 Jan 2009 10:26:12 -0500 Subject: [PATCH] Fixed var spelling errors. Accept more types for hints args. --- lib/mongo/collection.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index 02fdb2f..ad30ad6 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -31,11 +31,19 @@ module XGen end # Set hint fields to use and return +self+. hint_fields may be a - # single field name or array of field names. May be +nil+. If no hint - # fields are specified, the ones in the collection are used if they - # exist. + # single field name, array of field names, or a hash whose keys will + # become the hint field names. May be +nil+. def hint(hint_fields) - @hint_fileds = hint_fileds + @hint_fields = case hint_fields + when String + [hint_fields] + when Hash + hint_fields.keys + when nil + nil + else + hint_fields.to_a + end self end