Module: WeatherIcons::Rails::IconHelpers::Private

Extended by:
ActionView::Helpers::OutputSafetyHelper
Defined in:
lib/weather-icons/rails/helpers.rb

Class Method Summary collapse

Class Method Details

.array_value(value = []) ⇒ Object



129
130
131
# File 'lib/weather-icons/rails/helpers.rb', line 129

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

.icon_join(icon, text) ⇒ Object



120
121
122
123
# File 'lib/weather-icons/rails/helpers.rb', line 120

def self.icon_join(icon, text)
  return icon if text.blank?
  safe_join([icon, ERB::Util.html_escape(text)], " ")
end

.icon_names(names = []) ⇒ Object



125
126
127
# File 'lib/weather-icons/rails/helpers.rb', line 125

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