class Videos::Video

Constants

DEFAULTS

Attributes

options[RW]
uri[R]

Public Class Methods

new(uri,options={}) click to toggle source
# File lib/videos/video.rb, line 11
def initialize(uri,options={})
  @uri = uri
  @options = DEFAULTS.merge(options)
end

Public Instance Methods

controls() click to toggle source
# File lib/videos/video.rb, line 36
def controls
  @options[:controls]
end
embed_code() click to toggle source
# File lib/videos/video.rb, line 16
def embed_code
  content_tag(:video, '', controls: controls) do
    tag(:source, src: @uri.to_s, type: @uri.content_type) +
    content_tag(:span, sorry_message, class: 'sorry')
  end
end
Also aliased as: to_html
height() click to toggle source
# File lib/videos/video.rb, line 32
def height
  @options[:height]
end
provider() click to toggle source
# File lib/videos/video.rb, line 40
def provider
  @uri.provider
end
sorry_message() click to toggle source
# File lib/videos/video.rb, line 24
def sorry_message
  "I'm sorry; your browser doesn't support HTML5 video."
end
to_html()
Alias for: embed_code
width() click to toggle source
# File lib/videos/video.rb, line 28
def width
  @options[:width]
end