Sha256: fc6c658d072ecfd7c14bfd73e30f004afb85defe5cf419bc6c6fda77eaed3af3

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

require 'open-uri'
require 'openssl'

module PicturehouseUk
  # @api private
  module Internal
    # fetches pages from the picturehouse.com website
    class Website
      # get the cinema page with showings for passed id
      # @return [String]
      def cinema(id)
        get("cinema/#{id}")
      end

      # get the cinema contact information page for passed id
      # @return [String]
      def info(id)
        get("cinema/info/#{id}")
      end

      # get the home page
      # @return [String]
      def home
        get(nil)
      end

      private

      def get(path)
        # SSL verification doesn't work on picturehouses.com
        open("https://www.picturehouses.com/#{path}",
             ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE).read
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picturehouse_uk-3.0.6 lib/picturehouse_uk/internal/website.rb
picturehouse_uk-3.0.5 lib/picturehouse_uk/internal/website.rb
picturehouse_uk-3.0.4 lib/picturehouse_uk/internal/website.rb