Sha256: bd39571667c9491fabd001051d5a82488f818e1f977d6efbf1fae024f1153aab
Contents?: true
Size: 617 Bytes
Versions: 3
Compression:
Stored size: 617 Bytes
Contents
require 'rubygems' require 'addressable/uri' module DataMapper module Types class URI < DataMapper::Type primitive String def self.load(value, property) Addressable::URI.parse(value) end def self.dump(value, property) return nil if value.nil? value.to_s end def self.typecast(value, property) if value.kind_of?(Addressable::URI) value elsif value.nil? load(nil, property) else load(value.to_s, property) end end end # class URI end # module Types end # module DataMapper
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
dm-types-0.9.6 | lib/dm-types/uri.rb |
dm-types-0.9.7 | lib/dm-types/uri.rb |
mack-data_mapper-0.8.2 | lib/gems/dm-types-0.9.7/lib/dm-types/uri.rb |