Sha256: f72a03f7d0c0c14c304943a0416d421969dda50788856f0b561c52346c8a1714

Contents?: true

Size: 323 Bytes

Versions: 3

Compression:

Stored size: 323 Bytes

Contents

class RestModel
  module Serialization
    class Symbol
      def self.serialize(value, options = {})
        value.to_s.to_sym
      rescue
        raise SerializationError, "value '#{value}' is not a symbol"
      end

      def self.desserialize(value, options = {})
        serialize(value)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rest_model-0.3.1 lib/rest_model/serialization/symbol.rb
rest_model-0.3.0 lib/rest_model/serialization/symbol.rb
rest_model-0.2.3 lib/rest_model/serialization/symbol.rb