Sha256: 05f18f39aa7ff2b1c642b5423f4dd58c6c998e751c1c956a1c9d818448fe20a8

Contents?: true

Size: 468 Bytes

Versions: 33

Compression:

Stored size: 468 Bytes

Contents

module Kuhsaft
  class VideoBrick < Brick

    YOUTUBE = 'youtube'
    VIMEO = 'vimeo'
    EXTERNAL = 'external'

    attr_accessible :video, :embed_src, :href
    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

33 entries across 33 versions & 1 rubygems

Version Path
kuhsaft-1.8.6 app/models/kuhsaft/video_brick.rb
kuhsaft-1.8.5 app/models/kuhsaft/video_brick.rb
kuhsaft-2.0.2 app/models/kuhsaft/video_brick.rb
kuhsaft-1.8.4 app/models/kuhsaft/video_brick.rb
kuhsaft-1.8.1 app/models/kuhsaft/video_brick.rb
kuhsaft-2.0.1 app/models/kuhsaft/video_brick.rb
kuhsaft-2.0.0 app/models/kuhsaft/video_brick.rb
kuhsaft-1.8.0 app/models/kuhsaft/video_brick.rb
kuhsaft-1.7.1 app/models/kuhsaft/video_brick.rb
kuhsaft-1.7.0 app/models/kuhsaft/video_brick.rb
kuhsaft-1.6.0 app/models/kuhsaft/video_brick.rb
kuhsaft-1.5.0 app/models/kuhsaft/video_brick.rb
kuhsaft-1.4.3 app/models/kuhsaft/video_brick.rb
kuhsaft-1.4.2 app/models/kuhsaft/video_brick.rb
kuhsaft-1.4.1 app/models/kuhsaft/video_brick.rb
kuhsaft-1.4.0 app/models/kuhsaft/video_brick.rb
kuhsaft-1.3.1 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.15 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.14 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.13 app/models/kuhsaft/video_brick.rb