Class: PicturehouseUk::Internal::ScreeningParser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/picturehouse_uk/internal/film_with_screenings_parser.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.

parse an individual screening node

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ ScreeningParser

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.

Returns a new instance of ScreeningParser.

Parameters:

  • node (Nokogiri::HTML)

    a node with a film screening



60
61
62
# File 'lib/picturehouse_uk/internal/film_with_screenings_parser.rb', line 60

def initialize(node)
  @node = node
end

Instance Method Details

#bookable?Boolean

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.

is the screening bookable?

Returns:

  • (Boolean)


66
67
68
# File 'lib/picturehouse_uk/internal/film_with_screenings_parser.rb', line 66

def bookable?
  !!booking_url
end

#to_hashHash

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.

the attributes of a single screening

Examples:

Cineworld::Internal::ScreeningParser.new(html).to_hash
=> {
     booking_url: 'http://...',
     time:        <Time>,
     variant:     ['imax']
   }

Returns:

  • (Hash)


79
80
81
82
83
84
85
# File 'lib/picturehouse_uk/internal/film_with_screenings_parser.rb', line 79

def to_hash
  {
    booking_url: "http://www.picturehouses.co.uk#{booking_url}",
    time:        time,
    variant:     variant
  }
end