Class: CineworldUk::Internal::NameParser Private
- Inherits:
-
Object
- Object
- CineworldUk::Internal::NameParser
- Defined in:
- lib/cineworld_uk/internal/name_parser.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 string to derive a standardized movie title
Instance Attribute Summary collapse
-
#original_name ⇒ String
readonly
private
The original name.
Instance Method Summary collapse
-
#initialize(name) ⇒ NameParser
constructor
private
A new instance of NameParser.
-
#standardize ⇒ String
private
Process the name and return the final string.
-
#to_s ⇒ String
private
The processed name.
Constructor Details
#initialize(name) ⇒ NameParser
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 a new instance of NameParser.
11 12 13 14 |
# File 'lib/cineworld_uk/internal/name_parser.rb', line 11 def initialize(name) @original_name = name @name = name end |
Instance Attribute Details
#original_name ⇒ String (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.
Returns the original name.
8 9 10 |
# File 'lib/cineworld_uk/internal/name_parser.rb', line 8 def original_name @original_name end |
Instance Method Details
#standardize ⇒ 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.
Process the name and return the final string
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cineworld_uk/internal/name_parser.rb', line 18 def standardize strip_and_squeeze .ampersands_into_text .into_ampersand_if_second_to_last .remove_indian_languages .remove_screening_details .replace_non_film_prefix .remove_newlines .remove_dates .title_case to_s end |
#to_s ⇒ 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.
The processed name
33 34 35 |
# File 'lib/cineworld_uk/internal/name_parser.rb', line 33 def to_s @name end |