Class: VideoEmbed::YouTube::Url
- Inherits:
-
Object
- Object
- VideoEmbed::YouTube::Url
- Defined in:
- lib/video_embed/youtube.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #embed ⇒ Object
-
#initialize(url, options = {}) ⇒ Url
constructor
A new instance of Url.
Constructor Details
#initialize(url, options = {}) ⇒ Url
Returns a new instance of Url.
17 18 19 20 21 |
# File 'lib/video_embed/youtube.rb', line 17 def initialize(url, = {}) @url = url @width = .fetch(:width, 560) @height = .fetch(:height, 315) end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
15 16 17 |
# File 'lib/video_embed/youtube.rb', line 15 def height @height end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
15 16 17 |
# File 'lib/video_embed/youtube.rb', line 15 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
15 16 17 |
# File 'lib/video_embed/youtube.rb', line 15 def width @width end |
Instance Method Details
#embed ⇒ Object
23 24 25 |
# File 'lib/video_embed/youtube.rb', line 23 def %Q{<iframe width="#{width}" height="#{height}" src="http://www.youtube.com/embed/#{video_id}?rel=0" frameborder="0" allowfullscreen></iframe>} end |