Class: PicturehouseUk::Internal::FilmWithScreeningsParser Private
- Inherits:
-
Object
- Object
- PicturehouseUk::Internal::FilmWithScreeningsParser
- Defined in:
- lib/picturehouse_uk/internal/film_with_screenings_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 chunk of HTML to derive movie showing data
Constant Summary collapse
- FILM_NAME_CSS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
film name css
'.movielink'- SCREENING_CSS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
showings css
'a[epoch]'
Instance Method Summary collapse
-
#film_name ⇒ String
private
The film name.
-
#initialize(html) ⇒ FilmWithScreeningsParser
constructor
private
A new instance of FilmWithScreeningsParser.
-
#to_a ⇒ Array<Hash>
private
Showings hashes.
Constructor Details
#initialize(html) ⇒ FilmWithScreeningsParser
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 FilmWithScreeningsParser.
12 13 14 |
# File 'lib/picturehouse_uk/internal/film_with_screenings_parser.rb', line 12 def initialize(html) @html = html end |
Instance Method Details
#film_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.
The film name
18 19 20 |
# File 'lib/picturehouse_uk/internal/film_with_screenings_parser.rb', line 18 def film_name TitleSanitizer.new(raw_film_name).sanitized end |
#to_a ⇒ Array<Hash>
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.
Showings hashes
24 25 26 27 28 29 30 31 32 |
# File 'lib/picturehouse_uk/internal/film_with_screenings_parser.rb', line 24 def to_a return [] unless screenings? screening_nodes.map do |node| { film_name: film_name, dimension: dimension }.merge(ScreeningParser.new(node).to_hash) end end |