lib/dynamoid/finders.rb
def find(*ids)
        options = if ids.last.is_a? Hash
                    ids.slice!(-1)
                  else
                    {}
                  end
        expects_array = ids.first.kind_of?(Array)

        ids = Array(ids.flatten.uniq)
        if ids.count == 1
          result = self.find_by_id(ids.first, options)
          expects_array ? Array(result) : result
        else
          find_all(ids)
        end
      end
# Find one or many objects, specified by one id or an array of ids.
#
# @param [Array/String] *id an array of ids or one single id
#
# @return [Dynamoid::Document] one object or an array of objects, depending on whether the input was an array or not
#
# @since 0.2.0
Find one or many objects, specified by one id or an array of ids.
Find one or many objects specified by one id or an array of ids .
def find(*ids)
        options = if ids.last.is_a? Hash
                    ids.slice!(-1)
                  else
                    {}
                  end
        expects_array = ids.first.kind_of?(Array)
        ids = Array(ids.flatten.uniq)
        if ids.count == 1
          result = self.find_by_id(ids.first, options)
          expects_array ? Array(result) : result
        else
          find_all(ids)
        end
      end
def find ( * ids ) options = if ids . last . is_a? Hash ids . slice! ( - 1 ) else { } end expects_array = ids . first . kind_of? ( Array ) ids = Array ( ids . flatten . uniq ) if ids . count == 1 result = self . find_by_id ( ids . first , options ) expects_array ? Array ( result ) : result else find_all ( ids ) end end
Find one or many objects, specified by one id or an array of ids.
Find one or many objects specified by one id or an array of ids .
one object or an array of objects, depending on whether the input was an array or not
one object or an array of objects depending on whether the input was an array or not
Dynamoid::Document
ids
id an array of ids or one single id
id an array of ids or one single id
since
None