Module: FontAwesome::Rails::IconHelper::Private

Extended by:
ActionView::Helpers::OutputSafetyHelper
Defined in:
app/helpers/font_awesome/rails/icon_helper.rb

Class Method Summary collapse

Class Method Details

.array_value(value = []) ⇒ Object



86
87
88
# File 'app/helpers/font_awesome/rails/icon_helper.rb', line 86

def self.array_value(value = [])
  value.is_a?(Array) ? value : value.to_s.split(/\s+/)
end

.icon_join(icon, text) ⇒ Object



77
78
79
80
# File 'app/helpers/font_awesome/rails/icon_helper.rb', line 77

def self.icon_join(icon, text)
  return icon if text.blank?
  safe_join([icon, ERB::Util.html_escape(text)], " ")
end

.icon_names(names = []) ⇒ Object



82
83
84
# File 'app/helpers/font_awesome/rails/icon_helper.rb', line 82

def self.icon_names(names = [])
  array_value(names).map { |n| "fa-#{n}" }
end