Class: PicturehouseUk::Internal::FilmWithShowtimes Private
- Inherits:
-
Object
- Object
- PicturehouseUk::Internal::FilmWithShowtimes
- Defined in:
- lib/picturehouse_uk/internal/parser/screenings.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.
collection of timings for a specific film
Constant Summary collapse
- NAME =
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
'.top-mg-sm a'.freeze
- VARIANTS =
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.
variants css
'.film-times .col-xs-10'.freeze
Instance Method Summary collapse
-
#initialize(node, date) ⇒ FilmWithShowtimes
constructor
private
A new instance of FilmWithShowtimes.
-
#name ⇒ String
private
The film name.
-
#to_a ⇒ Array<Hash>
private
Showings hashes.
Constructor Details
#initialize(node, date) ⇒ FilmWithShowtimes
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 FilmWithShowtimes.
55 56 57 58 |
# File 'lib/picturehouse_uk/internal/parser/screenings.rb', line 55 def initialize(node, date) @node = node @date = date end |
Instance Method Details
#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
62 63 64 |
# File 'lib/picturehouse_uk/internal/parser/screenings.rb', line 62 def name TitleSanitizer.new(raw_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
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/picturehouse_uk/internal/parser/screenings.rb', line 68 def to_a Array(@node.css(VARIANTS)).flat_map do |variant| Variant.new(variant, @date).to_a.map do |hash| { film_name: name, dimension: dimension }.merge(hash) end end end |