# frozen_string_literal: true class WCC::Media::LiveStream < WCC::Media::Base active_record_shim do endpoint 'streams' key 'stream' filters %w[ ].freeze end %w[ title description ].each do |att| define_method att do raw[att] end end %w[ current_event next_event ].each do |att| define_method att do Event.new(raw[att]) if raw[att] end end def active? current_event.present? end class Event < WCC::Media::Base %w[ title description embed_code stream_url starts_at ends_at duration ].each do |att| define_method att do raw[att] end end end end