Sha256: a9dbd125dfc1e1e8905cd19e03e676350b91aa2ad098fa894ed4c91afb41fc33
Contents?: true
Size: 936 Bytes
Versions: 9
Compression:
Stored size: 936 Bytes
Contents
module CineworldUk # Internal utility classes: Do not use # @api private module Internal # Parses a chunk of HTML to derive movie showing data class WhatsonParser # css selector for film html chunks FILM_CSS = '#filter-reload > .span9 > .film' # @param [Integer] cinema_id cineworld cinema id def initialize(cinema_id) @cinema_id = cinema_id end # break up the whats on page into individual chunks for each film # @return [Array<String>] html chunks for a film and it's screenings def films_with_screenings films_html end private def films_html whatson_doc.css(FILM_CSS).map { |n| n.to_s.gsub(/^\s+/, '') } end def whatson @whatson ||= CineworldUk::Internal::Website.new.whatson(@cinema_id) end def whatson_doc @whatson_doc ||= Nokogiri::HTML(whatson) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems