Class: WinewooCore::Repositories::Mongo::CriterionsMongoRepo::GrapesFinder

Inherits:
Finder
  • Object
show all
Defined in:
lib/winewoo_core/repositories/mongo/criterions_mongo_repo.rb

Instance Method Summary collapse

Methods inherited from Finder

#initialize, #map

Constructor Details

This class inherits a constructor from WinewooCore::Repositories::Mongo::CriterionsMongoRepo::Finder

Instance Method Details

#findObject



114
115
116
117
118
119
# File 'lib/winewoo_core/repositories/mongo/criterions_mongo_repo.rb', line 114

def find
  res = GlobalWineData.all.first.grapes
  return @filters.query ?
    res.select{ |grape| grape.match(/^(#{@filters.query})/i) } :
    res
end