Methods

DataMapper::Property::CommaSeparatedList

Public Instance Methods

dump(value) click to toggle source
    # File lib/dm-types/comma_separated_list.rb, line 8
 8:       def dump(value)
 9:         if value.nil?
10:           nil
11:         elsif value.kind_of?(::Array)
12:           super(value)
13:         elsif value.kind_of?(::String)
14:           v = []
15: 
16:           value.split(',').each do |element|
17:             element.strip!
18:             v << element unless element.empty?
19:           end
20: 
21:           super(v)
22:         else
23:           raise ArgumentError, "+value+ of CommaSeparatedList must be a string, an array or nil, but given #{value.inspect}"
24:         end
25:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.