Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (24 sloc) 0.675 kb
require 'dm-core'
require 'dm-types/yaml'
module DataMapper
class Property
class CommaSeparatedList < Yaml
def dump(value)
if value.nil?
nil
elsif value.kind_of?(::Array)
super(value)
elsif value.kind_of?(::String)
v = []
value.split(',').each do |element|
element.strip!
v << element unless element.empty?
end
super(v)
else
raise ArgumentError, "+value+ of CommaSeparatedList must be a string, an array or nil, but given #{value.inspect}"
end
end # dump
end # CommaSeparatedList
end # Property
end # DataMapper
Jump to Line
Something went wrong with that request. Please try again.