class EmbedRb::Instagram

Public Class Methods

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

Private Instance Methods

render(url) click to toggle source
# File lib/embedrb/image/embed_instagram.rb, line 18
    def render(url)
      dims = EmbedRb.get_dimensions(@options)
      return <<EOF
      <div class="ejs-embed ejs-instagram">
        <div class="ne-image-wrapper">
          <iframe src="#{EmbedRb.to_url(url.split('/?')[0])}/embed/" width="#{dims[:width]}" height="#{dims[:height]}" ></iframe>
        </div>
      </div>
EOF
    end