Class: PicturehouseUk::Internal::Variant Private

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

variants can have multiple screenings

Constant Summary collapse

SHOWTIMES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'.btn'.freeze
VARIANT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'.film-type-desc'.freeze
TRANSLATOR =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  'Big Scream'    => 'baby',
  'IMAX'          => 'imax',
  "Kids' Club"    => 'kids',
  'NT Live'       => 'arts',
  'Screen Arts'   => 'arts',
  'Silver Screen' => 'senior'
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(node, date) ⇒ Variant

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 Variant.



104
105
106
107
# File 'lib/picturehouse_uk/internal/parser/screenings.rb', line 104

def initialize(node, date)
  @node = node
  @date = date
end

Instance Method Details

#to_aArray<Hash>

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.

Variant arrays

Returns:

  • (Array<Hash>)


111
112
113
114
115
# File 'lib/picturehouse_uk/internal/parser/screenings.rb', line 111

def to_a
  @node.css(SHOWTIMES).map do |node|
    { variant: variant }.merge(Showtime.new(@node, @date).to_hash)
  end
end