Class: CineworldUk::Performance

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

Overview

The object representing a single screening on the Cineworld UK website

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Object

Constructor

Parameters:

  • options (Hash)

    options hash

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/cineworld_uk/performance.rb', line 15

Instance Attribute Details

#booking_urlString (readonly)

Returns the booking URL on the cinema website.

Returns:

  • (String)

    the booking URL on the cinema website



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

#cinema_idString (readonly)

Returns the cinema id.

Returns:

  • (String)

    the cinema id



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

#cinema_nameString (readonly)

Returns the cinema name.

Returns:

  • (String)

    the cinema name



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

#dimensionString (readonly)

Returns 2d or 3d.

Returns:

  • (String)

    2d or 3d



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

#film_nameString (readonly)

Returns the film name.

Returns:

  • (String)

    the film name



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

Class Method Details

.at(cinema_id) ⇒ Array<CineworldUk::Screening>

All currently listed films showing at a cinema

Parameters:

  • cinema_id (Integer)

    id of the cinema on the website

Returns:

  • (Array<CineworldUk::Screening>)


28
29
30
31
32
33
34
35
# File 'lib/cineworld_uk/performance.rb', line 28

def self.at(cinema_id)
  cinema_id = cinema_id.to_i
  dates(cinema_id).flat_map do |date|
    performances_on(cinema_id, date).flat_map do |p|
      new cinema_hash(cinema_id).merge(p)
    end
  end
end

Instance Method Details

#showing_onDate

The date of the screening

Returns:

  • (Date)


# File 'lib/cineworld_uk/performance.rb', line 37

#starting_atTime

UTC time of the screening

Returns:

  • (Time)


# File 'lib/cineworld_uk/performance.rb', line 41

#variantArray[String]

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

Returns:

  • (Array[String])


# File 'lib/cineworld_uk/performance.rb', line 45