Sha256: 915219293bcbd0f1c14b7a45c90b05be1a95c5a13aeb3f39f163a9468915d0e5

Contents?: true

Size: 417 Bytes

Versions: 16

Compression:

Stored size: 417 Bytes

Contents

module Qbrick
  class VideoBrick < Brick
    YOUTUBE = 'youtube'
    VIMEO = 'vimeo'
    EXTERNAL = 'external'

    validates :any_source, presence: true

    # a video id, an embed code or a link to a video is required
    def any_source
      embed_src.presence || href.presence
    end

    def self.source_types
      [YOUTUBE, VIMEO, EXTERNAL]
    end

    def user_can_add_childs?
      false
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 app/models/qbrick/video_brick.rb
qbrick-2.7 app/models/qbrick/video_brick.rb
qbrick-2.6.10 app/models/qbrick/video_brick.rb
qbrick-2.6.9 app/models/qbrick/video_brick.rb
qbrick-2.6.8 app/models/qbrick/video_brick.rb
qbrick-2.6.7 app/models/qbrick/video_brick.rb
qbrick-2.6.6 app/models/qbrick/video_brick.rb
qbrick-2.6.5 app/models/qbrick/video_brick.rb
qbrick-2.6.4 app/models/qbrick/video_brick.rb
qbrick-2.6.3 app/models/qbrick/video_brick.rb
qbrick-2.6.2 app/models/qbrick/video_brick.rb
qbrick-2.6.1 app/models/qbrick/video_brick.rb
qbrick-2.6.0 app/models/qbrick/video_brick.rb
qbrick-2.5.2 app/models/qbrick/video_brick.rb
qbrick-2.5.1 app/models/qbrick/video_brick.rb
qbrick-2.5.0 app/models/qbrick/video_brick.rb