Sha256: 1dcce390bdfff7dd29341e52cbd2fd77f543efe0ea59289c6846774cbfef5d0e

Contents?: true

Size: 729 Bytes

Versions: 2

Compression:

Stored size: 729 Bytes

Contents

require 'dm-core'

require 'uri'

module DataMapper
  class Property
    module Legacy
      class URIText < Text

        #
        # Unescaped URI escaped data.
        #
        # @param [String, nil] value
        #   The URI escaped data.
        #
        # @return [String, nil]
        #   The URI unescaped data.
        #
        def load(value)
          ::URI.unescape(value) unless value.nil?
        end

        #
        # URI escapes data.
        #
        # @param [String, nil] value
        #   The raw data.
        #
        # @return [String, nil]
        #   The URI escaped data.
        #
        def dump(value)
          ::URI.escape(value) unless value.nil?
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-types-legacy-0.1.1 lib/dm-core/property/legacy/uri_text.rb
dm-types-legacy-0.1.0 lib/dm-core/property/legacy/uri_text.rb