Class: DataMapper::Property::Legacy::URIText

Inherits:
Text
  • Object
show all
Defined in:
lib/dm-core/property/legacy/uri_text.rb

Instance Method Summary collapse

Instance Method Details

#dump(value) ⇒ String?

URI escapes data.

Parameters:

  • value (String, nil)

    The raw data.

Returns:

  • (String, nil)

    The URI escaped data.



32
33
34
# File 'lib/dm-core/property/legacy/uri_text.rb', line 32

def dump(value)
  ::URI.escape(value) unless value.nil?
end

#load(value) ⇒ String?

Unescaped URI escaped data.

Parameters:

  • value (String, nil)

    The URI escaped data.

Returns:

  • (String, nil)

    The URI unescaped data.



19
20
21
# File 'lib/dm-core/property/legacy/uri_text.rb', line 19

def load(value)
  ::URI.unescape(value) unless value.nil?
end