Sha256: e821be630be1aa9ffb4e7ebf83c4502bed04939dd715021ca50c460faf6cb4e6

Contents?: true

Size: 869 Bytes

Versions: 5

Compression:

Stored size: 869 Bytes

Contents

require 'open-uri'

module OdeonUk
  # Internal utility classes: Do not use
  # @api private
  module Internal
    # Utility class to make calls to the odeon website
    class Website
      # cinema page
      # @param [Integer] cinema_id website id of the cinema
      # @return [String] html of the page
      def cinema(cinema_id)
        get("cinemas/odeon/#{cinema_id}/")
      end

      # showtimes page for a single cinema
      # @param [Integer] cinema_id website id of the cinema
      # @return [String] html of the page
      def showtimes(cinema_id)
        get("showtimes/week/#{cinema_id}/?siteId=#{cinema_id}")
      end

      # sitemap page
      # @return [String] html of the page
      def sitemap
        get('sitemap/')
      end

      private

      def get(path)
        URI("http://www.odeon.co.uk/#{path}").read
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
odeon_uk-2.0.4 lib/odeon_uk/internal/website.rb
odeon_uk-2.0.3 lib/odeon_uk/internal/website.rb
odeon_uk-2.0.2 lib/odeon_uk/internal/website.rb
odeon_uk-2.0.1 lib/odeon_uk/internal/website.rb
odeon_uk-2.0.0 lib/odeon_uk/internal/website.rb