class Bh::Classes::Icon
@api private
Private Class Methods
libraries()
click to toggle source
@return [Hash<Symbol, String>] the classes that Bootstrap requires to
append to icons for each possible vector icon library.
# File lib/bh/classes/icon.rb, line 25 def self.libraries HashWithIndifferentAccess.new(nil).tap do |klass| klass[:font_awesome] = :'fa' klass[:glyphicons] = :'glyphicon' klass[:''] = :'glyphicon' end end
Public Instance Methods
library_class()
click to toggle source
@return [#to_s] the class to assign to the icon based on the Vector
Icon library used.
# File lib/bh/classes/icon.rb, line 9 def library_class Icon.libraries[@options[:library].to_s.underscore] || @options[:library] end
name_class()
click to toggle source
@return [#to_s] the class to assign to the icon based on the name
of the icon.
# File lib/bh/classes/icon.rb, line 15 def name_class if name = @options[:name] "#{library_class}-#{name.to_s.gsub '_', '-'}" end end