Class: OdeonUk::Performance

Inherits:
Cinebase::Performance
  • Object
show all
Defined in:
lib/odeon_uk/performance.rb

Overview

The object representing a single screening of a film on the Odeon UK website

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Object

Options Hash (options):

  • :booking_url (String) — default: nil

    buying url for the screening

  • :cinema_name (String)

    name of the cinema

  • :cinema_id (String)

    website id of the cinema

  • :dimension (String) — default: '2d'

    dimension of the screening

  • :film_name (String)

    name of the film

  • :starting_at (Time)

    listed start time of the performance


# File 'lib/odeon_uk/performance.rb', line 15


Instance Attribute Details

#booking_urlString (readonly)


# File 'lib/odeon_uk/performance.rb', line 4


#cinema_idString (readonly)


# File 'lib/odeon_uk/performance.rb', line 4


#cinema_nameString (readonly)


# File 'lib/odeon_uk/performance.rb', line 4


#dimensionString (readonly)


# File 'lib/odeon_uk/performance.rb', line 4


#film_nameString (readonly)


# File 'lib/odeon_uk/performance.rb', line 4


Class Method Details

.at(cinema_id) ⇒ Array<OdeonUk::Performance>

All currently listed films showing at a cinema


27
28
29
30
31
32
33
34
35
36
37
# File 'lib/odeon_uk/performance.rb', line 27

def self.at(cinema_id)
  cinema_id = cinema_id.to_i
  film_ids_at(cinema_id).flat_map do |film_id|
    api_response.film_times(cinema_id, film_id).flat_map do |day|
      performance_days(day).map do |hash|
        new(hash.merge(cinema_hash(cinema_id))
                .merge(film_name: film_name(film_id)))
      end
    end
  end
end

Instance Method Details

#showing_onDate

The date of the screening


# File 'lib/odeon_uk/performance.rb', line 39


#starting_atTime

UTC time of the screening


# File 'lib/odeon_uk/performance.rb', line 43


#variantArray[String]

The kinds of screening (IMAX, kids, baby, senior)


# File 'lib/odeon_uk/performance.rb', line 47