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.2.12 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.11 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.10 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.9 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.8 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.7 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.6 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.5 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.4 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.3 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.2 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.1 app/models/kuhsaft/video_brick.rb
kuhsaft-1.2.0 app/models/kuhsaft/video_brick.rb