Module: Integral::Video::Embed::Labnol

Defined in:
lib/integral/video/embed/labnol.rb

Class Method Summary collapse

Class Method Details

.html(uid, thumbnail: nil) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/integral/video/embed/labnol.rb', line 8

def html(uid, thumbnail: nil)
  fail ArgumentError, "`uid` must be provided, you passed #{uid.inspect}" if uid.nil? || uid == ""
  thumbnail = nil if thumbnail == ""
  [
    "<div",
    " class=\"labnol__youtube-player\"",
    " data-id=\"#{uid}\"",
   (" data-thumbnail=\"#{thumbnail}\"" if thumbnail),
    "></div>"
  ].reject(&:nil?).join
end