Sha256: 07d8d71a44782892f7bf6de901b7bf9a8db2e56bd6283933e7b45cfe41731417

Contents?: true

Size: 422 Bytes

Versions: 11

Compression:

Stored size: 422 Bytes

Contents

module Kuhsaft
  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

11 entries across 11 versions & 1 rubygems

Version Path
kuhsaft-2.2.6 app/models/kuhsaft/video_brick.rb
kuhsaft-2.2.5 app/models/kuhsaft/video_brick.rb
kuhsaft-2.2.4 app/models/kuhsaft/video_brick.rb
kuhsaft-2.2.3 app/models/kuhsaft/video_brick.rb
kuhsaft-2.2.2 app/models/kuhsaft/video_brick.rb
kuhsaft-2.2.1 app/models/kuhsaft/video_brick.rb
kuhsaft-2.2.0 app/models/kuhsaft/video_brick.rb
kuhsaft-2.1.2 app/models/kuhsaft/video_brick.rb
kuhsaft-2.1.1 app/models/kuhsaft/video_brick.rb
kuhsaft-2.1.0 app/models/kuhsaft/video_brick.rb
kuhsaft-2.0.3 app/models/kuhsaft/video_brick.rb