Sha256: dc33c40f38bc4b725f35df62dac1da706b2c14b8eb5a09589e616a9736639739
Contents?: true
Size: 1.13 KB
Versions: 6
Compression:
Stored size: 1.13 KB
Contents
module CineworldUk # @api private module Internal module Parser module Api # Parses a single json hash to produce time details class Performance # @param [Hash] data from one performance # @return [CineworldUk::Internal::Parser::Api::Performance] def initialize(data) @data = data end # @return [String] direct booking url def booking_url "http://www.cineworld.co.uk#{@data['url']}" end # @return [Integer] id for film lookup def film_id @data['film'] end # @return [DateTime] in local time def starting_at Time.strptime(time_str, '%Y%m%d %H:%S') end # @return [Array<String>] includes audio described & subtitled def variant [ @data['ad'] ? 'audio_described' : nil, @data['subtitled'] ? 'subtitled' : nil ].compact end private def time_str "#{@data['date']} #{@data['time']}" end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems