Module: FlatUI::Rails::IconHelper::Private

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

Class Method Summary collapse

Class Method Details

.array_value(value = []) ⇒ Object



54
55
56
# File 'app/helpers/flat_ui/rails/icon_helper.rb', line 54

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

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



43
44
45
46
47
48
# File 'app/helpers/flat_ui/rails/icon_helper.rb', line 43

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



50
51
52
# File 'app/helpers/flat_ui/rails/icon_helper.rb', line 50

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