Class: VideoEmbed::Vimeo::Url

Inherits:
Object
  • Object
show all
Defined in:
lib/video_embed/vimeo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}) ⇒ Url

Returns a new instance of Url.



15
16
17
18
19
# File 'lib/video_embed/vimeo.rb', line 15

def initialize(url, options = {})
  @url = url
  @width = options.fetch(:width, 560)
  @height = options.fetch(:height, 315)
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



13
14
15
# File 'lib/video_embed/vimeo.rb', line 13

def height
  @height
end

#urlObject (readonly)

Returns the value of attribute url.



13
14
15
# File 'lib/video_embed/vimeo.rb', line 13

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



13
14
15
# File 'lib/video_embed/vimeo.rb', line 13

def width
  @width
end

Instance Method Details

#embedObject



21
22
23
# File 'lib/video_embed/vimeo.rb', line 21

def embed
  %Q{<iframe src="http://player.vimeo.com/video/#{video_id}?title=0&amp;byline=0&amp;portrait=0" width="#{width}" height="#{height}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>}
end