Sha256: 5fbdeff0ffd9722d7a239572f2cc39f43072aaa20ca85f23e4e45a7b9bcd20b7

Contents?: true

Size: 851 Bytes

Versions: 6

Compression:

Stored size: 851 Bytes

Contents

require 'open-uri'

module PicturehouseUk
  # @api private
  module Internal
    # fetches pages from the picturehouse.co.uk 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 contact_us(id)
        get("cinema/#{id}/Hires_Info/Contact_Us/")
      end

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

      # get the cinema page containing all upcoming films and screenings
      # @return [String]
      def whatson(id)
        get("whatson?cinema=#{id}")
      end

      private

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

Version data entries

6 entries across 6 versions & 1 rubygems

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