Class: OdeonUk::Internal::Parser::Api::FilmLookup Private
- Inherits:
-
Object
- Object
- OdeonUk::Internal::Parser::Api::FilmLookup
- Defined in:
- lib/odeon_uk/internal/parser/api/film_lookup.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 address
Instance Method Summary collapse
-
#at(cinema_id) ⇒ Hash{Integer => OdeonUk::Internal::Parser::Api::Film}
private
contains all films keyed by id for a cinema.
-
#to_hash ⇒ Hash{Integer => OdeonUk::Internal::Parser::Api::Film}
private
contains all films & upcoming films keyed by id.
Instance Method Details
#at(cinema_id) ⇒ Hash{Integer => OdeonUk::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.
contains all films keyed by id for a cinema
11 12 13 14 15 |
# File 'lib/odeon_uk/internal/parser/api/film_lookup.rb', line 11 def at(cinema_id) to_hash.select do |_, film_hash| film_hash['sites'].include?(cinema_id) end end |
#to_hash ⇒ Hash{Integer => OdeonUk::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.
contains all films & upcoming films keyed by id
19 20 21 22 23 |
# File 'lib/odeon_uk/internal/parser/api/film_lookup.rb', line 19 def to_hash @to_hash ||= api.each_with_object({}) do |film_hash, result| result[film_hash['filmMasterId'].to_i] = film_hash end end |