Class: CineworldUk::Internal::Parser::Api::PerformancesByDay Private
- Inherits:
-
Object
- Object
- CineworldUk::Internal::Parser::Api::PerformancesByDay
- Defined in:
- lib/cineworld_uk/internal/parser/api/performances_by_day.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.
A day of performances, a parser for a single API call
Instance Method Summary collapse
-
#initialize(cinema_id, date, film_lookup) ⇒ PerformancesByDay
constructor
private
A new instance of PerformancesByDay.
-
#to_a ⇒ Array<Hash>
private
Details of performance from single day :starting_at, :variant.
Constructor Details
#initialize(cinema_id, date, film_lookup) ⇒ PerformancesByDay
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 PerformancesByDay.
8 9 10 11 12 |
# File 'lib/cineworld_uk/internal/parser/api/performances_by_day.rb', line 8 def initialize(cinema_id, date, film_lookup) @cinema_id = cinema_id @date = date @film_lookup = film_lookup end |
Instance Method Details
#to_a ⇒ Array<Hash>
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.
Details of performance from single day :starting_at, :variant
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cineworld_uk/internal/parser/api/performances_by_day.rb', line 17 def to_a performances.map do |performance| film = @film_lookup[performance.film_id] { booking_url: performance.booking_url, dimension: film.dimension, film_name: film.name, starting_at: utc(performance.starting_at), variant: (performance.variant + film.variant).sort } end end |