Class: CineworldUk::Internal::Parser::Api::Performance Private
- Inherits:
-
Object
- Object
- CineworldUk::Internal::Parser::Api::Performance
- 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
-
#booking_url ⇒ String
private
Direct booking url.
-
#film_id ⇒ Integer
private
Id for film lookup.
- #initialize(data) ⇒ CineworldUk::Internal::Parser::Api::Performance constructor private
-
#starting_at ⇒ DateTime
private
In local time.
-
#variant ⇒ Array<String>
private
Includes audio described & subtitled.
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_url ⇒ 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 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_id ⇒ Integer
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_at ⇒ DateTime
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 |
#variant ⇒ Array<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 |