Sha256: 1e5de0b6ec8643d3612253c037a9f2ab3e49e5db9a8bc25fc6fad1b7229022c8
Contents?: true
Size: 674 Bytes
Versions: 53
Compression:
Stored size: 674 Bytes
Contents
module Onebox module Engine class TrelloOnebox include Engine include StandardEmbed matches_regexp(/^https:\/\/trello\.com\/[bc]\/\W*/) always_https def to_html link = "https://trello.com/#{match[:type]}/#{match[:key]}.html" height = match[:type] == 'b' ? 400 : 200 <<-HTML <iframe src=\"#{link}\" width=\"100%\" height=\"#{height}\" frameborder=\"0\" style=\"border:0\"></iframe> HTML end private def match return @match if @match @match = @url.match(%{trello\.com/(?<type>[^/]+)/(?<key>[^/]+)/?\W*}) @match end end end end
Version data entries
53 entries across 53 versions & 1 rubygems