Class: CineworldUk::Internal::Parser::Api::Film Private
- Inherits:
-
Object
- Object
- CineworldUk::Internal::Parser::Api::Film
- Defined in:
- lib/cineworld_uk/internal/parser/api/film.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 hash to produce film information
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
private
the cineworld id for the film.
Instance Method Summary collapse
-
#dimension ⇒ String
private
Do you need your 3D glasses?.
- #initialize(data) ⇒ CineworldUk::Internal::Parser::Api::Film constructor private
-
#name ⇒ String
private
Sanitized film name.
-
#variant ⇒ Array<String>
private
List of strings representing different kinds of performance, such as autism, kids, imax, members or q&a.
Constructor Details
#initialize(data) ⇒ CineworldUk::Internal::Parser::Api::Film
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.
13 14 15 16 |
# File 'lib/cineworld_uk/internal/parser/api/film.rb', line 13 def initialize(data) @data = data @id = @data['edi'] end |
Instance Attribute Details
#id ⇒ Object (readonly)
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.
the cineworld id for the film
9 10 11 |
# File 'lib/cineworld_uk/internal/parser/api/film.rb', line 9 def id @id end |
Instance Method Details
#dimension ⇒ 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.
Do you need your 3D glasses?
20 21 22 |
# File 'lib/cineworld_uk/internal/parser/api/film.rb', line 20 def dimension @data['format'] =~ /3D/i ? '3d' : '2d' end |
#name ⇒ 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.
Sanitized film name
26 27 28 |
# File 'lib/cineworld_uk/internal/parser/api/film.rb', line 26 def name TitleSanitizer.new(@data['originalTitle'] || '').sanitized 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.
List of strings representing different kinds of performance, such as autism, kids, imax, members or q&a
33 34 35 36 37 38 39 40 41 |
# File 'lib/cineworld_uk/internal/parser/api/film.rb', line 33 def variant [ @data['title'] =~ /Autism Friendly/i ? 'autism_friendly' : nil, @data.fetch('format', '') =~ /IMAX/i ? 'imax' : nil, @data['title'] =~ /Movies for Juniors/i ? 'kids' : nil, @data['title'] =~ /Unlimited Screening/i ? 'members' : nil, @data['title'] =~ /Q (and|&) A/i ? 'q&a' : nil ].compact end |