Class: DataMapper::Property::URI

Inherits:
String
  • Object
show all
Defined in:
lib/dm-types/uri.rb

Instance Method Summary collapse

Instance Method Details

#dump(value) ⇒ Object



18
19
20
# File 'lib/dm-types/uri.rb', line 18

def dump(value)
  value.to_str unless value.nil?
end

#load(value) ⇒ Object



13
14
15
16
# File 'lib/dm-types/uri.rb', line 13

def load(value)
  uri = Addressable::URI.parse(value)
  uri.normalize unless uri.nil?
end

#typecast(value) ⇒ Object



22
23
24
# File 'lib/dm-types/uri.rb', line 22

def typecast(value)
  load(value) unless value.nil?
end