Module: Fandango::TheaterShowtimes::Parser

Defined in:
lib/fandango/api/theater_showtimes.rb

Class Method Summary collapse

Class Method Details

.call(html) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fandango/api/theater_showtimes.rb', line 29

def call(html)
  doc = Nokogiri.HTML(html)
  doc.css('.showtimes-movie-container').map do |movie_node|
    movie = Movie.parse(movie_node)
    movie[:showtimes] =
      movie_node.at_css('.showtimes-times').css('a').map do |showtime_node|
        Showtime.parse(showtime_node)
      end
    movie
  end
end