Sha256: b5e4cb258fecb9c7f411b72d1206b8dcd8bf5c7c923b32cb065c2308afa704ae

Contents?: true

Size: 709 Bytes

Versions: 15

Compression:

Stored size: 709 Bytes

Contents

# 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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
wcc-media-client-0.7.5 lib/wcc/media/live_stream.rb
wcc-media-client-0.7.4 lib/wcc/media/live_stream.rb
wcc-media-client-0.7.3 lib/wcc/media/live_stream.rb
wcc-media-client-0.7.2 lib/wcc/media/live_stream.rb
wcc-media-client-0.7.1 lib/wcc/media/live_stream.rb
wcc-media-client-0.7.0 lib/wcc/media/live_stream.rb
wcc-media-client-0.6.1 lib/wcc/media/live_stream.rb
wcc-media-client-0.6.0 lib/wcc/media/live_stream.rb
wcc-media-client-0.5.0 lib/wcc/media/live_stream.rb
wcc-media-client-0.4.15 lib/wcc/media/live_stream.rb
wcc-media-client-0.4.14 lib/wcc/media/live_stream.rb
wcc-media-client-0.4.13 lib/wcc/media/live_stream.rb
wcc-media-client-0.4.12 lib/wcc/media/live_stream.rb
wcc-media-client-0.4.11 lib/wcc/media/live_stream.rb
wcc-media-client-0.4.10 lib/wcc/media/live_stream.rb