Class: OdeonUk::Internal::Parser::Api::FilmLookup Private

Inherits:
Object
  • Object
show all
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

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

Parameters:

  • cinema_id (Integer)

    id of the cinema

Returns:

  • (Hash{Integer => OdeonUk::Internal::Parser::Api::Film})


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_hashHash{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

Returns:

  • (Hash{Integer => OdeonUk::Internal::Parser::Api::Film})


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