octicon

in lib/octicons_helper/lib/octicons_helper/helper.rb [8:23]


  def octicon(symbol, options = {})
    return "" if symbol.nil?

    cache_key = [symbol, options]

    if tag = octicons_helper_cache[cache_key]
      tag
    else
      icon = Octicons::Octicon.new(symbol, options)

      tag = content_tag(:svg, icon.path.html_safe, icon.options).freeze 
      octicons_helper_cache[cache_key] = tag
      tag
    end
  end