Module: Rawfeed::AddClassHtml
- Defined in:
- lib/rawfeed/with_class.rb
Instance Method Summary collapse
- #with_class(input, class_name) ⇒ Object (also: #add_class_html)
Instance Method Details
#with_class(input, class_name) ⇒ Object Also known as: add_class_html
9 10 11 12 13 |
# File 'lib/rawfeed/with_class.rb', line 9 def with_class(input, class_name) return input if input.to_s.strip.empty? html_output = "<span class=\"#{class_name}\">#{input.to_s}</span>" return html_output end |