module Feeligo::Stickers

Constants

VERSION

Public Class Methods

loader_script_tag(opts = {}) click to toggle source

Returns a <script> tag which can be added to a View to load the Feeligo Stickers module. The <script> tag should be inserted right after the opening <body> tag

# File lib/feeligo/stickers.rb, line 12
def self.loader_script_tag opts = {}
  LoaderScriptTag.new(opts).to_s
end
replace_sticker_tags(string, opts = {}) click to toggle source

Takes a string and returns a copy of it with all [s:PATH] tags replaced with HTML <img> tags

# File lib/feeligo/stickers.rb, line 19
def self.replace_sticker_tags string, opts = {}
  string.gsub(/\[s:(.+?)\]/){|m| StickerImageTag.new($1, opts).to_s}
end