class Humpyard::UriParser::AssetsUriParser

Public Class Methods

substitute(content, options = {}) click to toggle source
# File lib/humpyard/uri_parser/assets_uri_parser.rb, line 4
def self.substitute content, options = {}
  content.gsub(/humpyard:\/\/asset\/([0-9]*)/) do |uri| 
    begin
      "#{options[:prefix]}#{Asset.find($1).url}#{options[:postfix]}"  
    rescue
      ''
    end
  end
end