Module: DrgMaterialIcons::Rails::IconHelper::Private
- Extended by:
- ActionView::Helpers::OutputSafetyHelper
- Defined in:
- app/helpers/drg_material_icons/rails/icon_helper.rb
Class Method Summary collapse
- .array_value(value = []) ⇒ Object
- .icon_join(icon, text, reverse_order = false) ⇒ Object
- .icon_names(names = []) ⇒ Object
Class Method Details
.array_value(value = []) ⇒ Object
106 107 108 |
# File 'app/helpers/drg_material_icons/rails/icon_helper.rb', line 106 def self.array_value(value = []) value.is_a?(Array) ? value : value.to_s.split(/\s+/) end |
.icon_join(icon, text, reverse_order = false) ⇒ Object
95 96 97 98 99 100 |
# File 'app/helpers/drg_material_icons/rails/icon_helper.rb', line 95 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
102 103 104 |
# File 'app/helpers/drg_material_icons/rails/icon_helper.rb', line 102 def self.icon_names(names = []) array_value(names).map { |n| "mi-#{n}" } end |