Class: CineworldUk::Internal::Parser::Api::Performance Private

Inherits:
Object
  • Object
show all
Defined in:
lib/cineworld_uk/internal/parser/api/performance.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 single json hash to produce time details

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CineworldUk::Internal::Parser::Api::Performance

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.



10
11
12
# File 'lib/cineworld_uk/internal/parser/api/performance.rb', line 10

def initialize(data)
  @data = data
end

Instance Method Details

#booking_urlString

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 direct booking url.



15
16
17
# File 'lib/cineworld_uk/internal/parser/api/performance.rb', line 15

def booking_url
  "http://www.cineworld.co.uk#{@data['url']}"
end

#film_idInteger

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 id for film lookup.



20
21
22
# File 'lib/cineworld_uk/internal/parser/api/performance.rb', line 20

def film_id
  @data['film']
end

#starting_atDateTime

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 in local time.



25
26
27
# File 'lib/cineworld_uk/internal/parser/api/performance.rb', line 25

def starting_at
  Time.strptime(time_str, '%Y%m%d %H:%S')
end

#variantArray<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.

Returns includes audio described & subtitled.



30
31
32
33
34
35
# File 'lib/cineworld_uk/internal/parser/api/performance.rb', line 30

def variant
  [
    @data['ad'] ? 'audio_described' : nil,
    @data['subtitled'] ? 'subtitled' : nil
  ].compact
end