Module: Cryptofont::Rails::IconHelper::Private
- Extended by:
- ActionView::Helpers::OutputSafetyHelper
- Defined in:
- app/helpers/cryptofont/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
42 43 44 |
# File 'app/helpers/cryptofont/rails/icon_helper.rb', line 42 def self.array_value(value = []) value.is_a?(Array) ? value : value.to_s.split(/\s+/) end |
.icon_join(icon, text, reverse_order = false) ⇒ Object
31 32 33 34 35 36 |
# File 'app/helpers/cryptofont/rails/icon_helper.rb', line 31 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
38 39 40 |
# File 'app/helpers/cryptofont/rails/icon_helper.rb', line 38 def self.icon_names(names = []) array_value(names).map { |n| "cf-#{n}" } end |