module EvilIcons::Helpers
Public Instance Methods
evil_icon(name, options = {})
click to toggle source
# File lib/evil_icons/helpers.rb, line 8 def evil_icon(name, options = {}) size = options[:size] ? "icon--#{options[:size]}" : '' options[:class] = "icon icon--#{name} #{size} #{options[:class]}" icon = "<svg class='icon__cnt'><use xlink:href='##{name}-icon'/></svg>" html_safe " <div class='#{options[:class]}'> #{wrap_spinner icon, options[:class]} </div> " end
evil_icons_sprite()
click to toggle source
# File lib/evil_icons/helpers.rb, line 4 def evil_icons_sprite html_safe File.new(EvilIcons.sprite_file).read end
Private Instance Methods
html_safe(html)
click to toggle source
# File lib/evil_icons/helpers.rb, line 32 def html_safe(html) html.respond_to?(:html_safe) ? html.html_safe : html end
wrap_spinner(html, klass)
click to toggle source
# File lib/evil_icons/helpers.rb, line 24 def wrap_spinner(html, klass) if klass.include?("spinner") html_safe "<div class='icon__spinner'>#{html}</div>" else html end end