Class: CineworldUk::Internal::WhatsonParser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cineworld_uk/internal/whatson_parser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Parses a chunk of HTML to derive movie showing data

Constant Summary collapse

FILM_CSS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

css selector for film html chunks

'#filter-reload > .span9 > .row:not(.schedule)'
SCREENINGS_CSS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

css selector for screenings html chunks

'#filter-reload > .span9 > .schedule'

Instance Method Summary collapse

Constructor Details

#initialize(cinema_id) ⇒ WhatsonParser

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of WhatsonParser.

Parameters:

  • cinema_id (Integer)

    cineworld cinema id



13
14
15
# File 'lib/cineworld_uk/internal/whatson_parser.rb', line 13

def initialize(cinema_id)
  @cinema_id = cinema_id
end

Instance Method Details

#films_with_screeningsArray<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

break up the whats on page into individual chunks for each film

Returns:

  • (Array<String>)

    html chunks for a film and it’s screenings



19
20
21
22
23
# File 'lib/cineworld_uk/internal/whatson_parser.rb', line 19

def films_with_screenings
  films_html.each_with_index.map do |html, i|
    html + screenings_html[i]
  end
end