Module: Gimlet::Queryable::API
Instance Method Summary collapse
Instance Method Details
#new_query ⇒ Object
18 19 20 |
# File 'lib/gimlet/queryable.rb', line 18 def new_query current_scope || Query.new(self) end |
#select(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/gimlet/queryable.rb', line 8 def select( = {}) selecting = @instances [:where].each do |attribute, operator, argument| selecting = selecting.select do |id, instance| instance[attribute].send(operator, argument) end end selecting.values end |