# File lib/aws/simple_db/item_collection.rb, line 282 def select *attributes, &block # Before select was morphed into a chainable method, it accepted # a hash of options (e.g. :where, :order, :limit) that no longer # make sense, but to maintain backwards compatability we still # consume those. # # TODO : it would be a good idea to add a deprecation warning for # passing options to #select # handle_query_options(*attributes) do |collection, *args| return collection.select(*args, &block) end options = attributes.last.is_a?(Hash) ? attributes.pop : {} output_list = case attributes.flatten when [] then '*' when ['*'] then '*' when [:all] then '*' else attributes.flatten.map{|attr| coerce_attribute(attr) }.join(', ') end collection = collection_with(:output_list => output_list) if block_given? # previously select accepted a block and it would enumerate items # this is for backwards compatability collection.each(options, &block) nil else collection end end