Class: Parsers::WinesParser

Inherits:
Object
  • Object
show all
Defined in:
lib/winewoo_core/services/elastic_search/parsers/wines_parser.rb

Class Method Summary collapse

Class Method Details

.parse(raw_data) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/winewoo_core/services/elastic_search/parsers/wines_parser.rb', line 6

def parse(raw_data)
  ids = raw_data.map { |raw_entry| raw_entry["_id"] }
  # TODO UNOFFICIALS
  # query = WinewooCore::Repositories::Mongo::Queries::WineQuery.new.officials.published
  Rails.logger.info "WINEWOO IDS #{ids.to_json}"
  query = WinewooCore::Repositories::Mongo::Queries::WineQuery.new.officials.published
  query.find(ids)
end