Module: RSS::Utils::CSV

Defined in:
lib/rss/utils.rb

Class Method Summary collapse

Class Method Details

.parse(value, &block) ⇒ Object



141
142
143
144
145
146
147
148
149
# File 'lib/rss/utils.rb', line 141

def parse(value, &block)
  if value.is_a?(String)
    value = value.strip.split(/\s*,\s*/)
    value = value.collect(&block) if block_given?
    value
  else
    value
  end
end