module PrettyMagic::KeyruneIcons::ClassMethods

Public Instance Methods

set_symbols(set_code, options = {}) click to toggle source
# File lib/pretty_magic/keyrune_icons.rb, line 4
def set_symbols(set_code, options = {})
  options = {color: 'common', size: 1, fixed_width: false, gradient: false}.merge(options)
  
  prettySymbol = "ss-" + set_code.downcase[/{(.*?)}/, 1]  
    
  i_tag(prettySymbol + ' ' + optional_classes(options[:color], options[:size], options[:fixed_width], options[:gradient]))
end

Private Instance Methods

i_tag(inner_classes) click to toggle source
# File lib/pretty_magic/keyrune_icons.rb, line 14
def i_tag(inner_classes)
    '<i class="ss ' + inner_classes +'"></i>'
end
optional_classes(color, size, fixed_width, gradient) click to toggle source
# File lib/pretty_magic/keyrune_icons.rb, line 18
def optional_classes(color, size, fixed_width, gradient)
    
    class_text = ""
    
    if(color)
      class_text += "ss-#{color} "
    end
    if(size > 1)
      class_text += "ss-#{size}x "
    end
    if(fixed_width)
      class_text += "ss-fw "
    end 
    if(gradient)
      class_text += "ss-grad "
    end
    
    class_text
end