class Onebox::Engine::SimplecastOnebox

Public Instance Methods

placeholder_html() click to toggle source
# File lib/onebox/engine/simplecast_onebox.rb, line 17
def placeholder_html
  oembed = get_oembed
  return if Onebox::Helpers.blank?(oembed.thumbnail_url)
  "<img src='#{oembed.thumbnail_url}' #{oembed.title_attr}>"
end
to_html() click to toggle source
# File lib/onebox/engine/simplecast_onebox.rb, line 13
def to_html
  get_oembed.html
end

Private Instance Methods

get_oembed_url() click to toggle source
# File lib/onebox/engine/simplecast_onebox.rb, line 25
def get_oembed_url
  if id = url.scan(/([a-zA-Z0-9]*)\Z/).flatten.first
    oembed_url = "https://simplecast.com/s/#{id}"
  else
    oembed_url = url
  end

  "https://simplecast.com/oembed?url=#{oembed_url}"
end