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