Class: OdeonUk::Internal::Parser::Api::PerformanceDay Private

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

A single day of performances for a particular film

Defined Under Namespace

Classes: TimeParser

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PerformanceDay

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


8
9
10
# File 'lib/odeon_uk/internal/parser/api/performance_day.rb', line 8

def initialize(data)
  @data = data
end

Instance Method Details

#to_aObject

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.


12
13
14
15
16
17
18
19
20
21
22
# File 'lib/odeon_uk/internal/parser/api/performance_day.rb', line 12

def to_a
  performance_kinds.each_with_index.flat_map do |_, index|
    starting_times(index).map do |time|
      {
        dimension: dimension(index),
        starting_at: TimeParser.new(date, time).to_utc,
        variant: variant(index)
      }
    end
  end
end