Module: UrijiIcons::Rails::IconHelper::Private

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

Class Method Summary collapse

Class Method Details

.array_value(value = []) ⇒ Object



47
48
49
# File 'app/helpers/uriji_icons/rails/icon_helper.rb', line 47

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

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



36
37
38
39
40
41
# File 'app/helpers/uriji_icons/rails/icon_helper.rb', line 36

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



43
44
45
# File 'app/helpers/uriji_icons/rails/icon_helper.rb', line 43

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