class EmbedRb::Ted

Public Class Methods

new(input, output, options, embeds) click to toggle source
# File lib/embedrb/video/embed_ted.rb, line 8
def initialize(input, output, options, embeds)
  @input = input
  @output = output
  @embeds = embeds
  @options = options
  @regex = /(ted.com\/talks\/([a-zA-Z0-9_]+))/mi
  @service = :ted
end

Private Instance Methods

render(_id) click to toggle source
# File lib/embedrb/video/embed_ted.rb, line 23
    def render(_id)
      dims = EmbedRb.get_dimensions(@options)
      return <<EOF
      <div class="ejs-embed ejs-ted">
        <iframe src="http://embed.ted.com/talks/#{_id}.html" height="#{dims[:height]}" width="#{dims[:width]}" ></iframe>
      </div>
EOF
    end
url_to_text(matched) click to toggle source
# File lib/embedrb/video/embed_ted.rb, line 18
def url_to_text(matched)
  _id = matched[1]
  return render _id
end