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



94
95
96
# File 'app/helpers/font_awesome/rails/icon_helper.rb', line 94

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

.icon_join(icon, text, reverse_order = false) ⇒ Object



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

def self.icon_join(icon, text, reverse_order = false)
  return icon if text.blank?
  elements = [icon, ERB::Util.html_escape(text)]
  elements.reverse! if reverse_order
  safe_join(elements, " ")
end

.icon_names(names = []) ⇒ Object



90
91
92
# File 'app/helpers/font_awesome/rails/icon_helper.rb', line 90

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