Sha256: 0df6bc7896e271e96be1038e990314405b6c790605c21ee653a3e698819ff57c

Contents?: true

Size: 377 Bytes

Versions: 8

Compression:

Stored size: 377 Bytes

Contents

class RestModel
  module Serialization
    class Integer
      def self.serialize(value)
        Integer(value)
      rescue
        raise SerializationError, "value '#{value}' is not an integer"
      end

      def self.desserialize(value)
        Integer(value)
      rescue
        raise SerializationError, "value '#{value}' is not an integer"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rest_model-0.1.17 lib/rest_model/serialization/integer.rb
rest_model-0.1.16 lib/rest_model/serialization/integer.rb
rest_model-0.1.15 lib/rest_model/serialization/integer.rb
rest_model-0.1.14 lib/rest_model/serialization/integer.rb
rest_model-0.1.13 lib/rest_model/serialization/integer.rb
rest_model-0.1.12 lib/rest_model/serialization/integer.rb
rest_model-0.1.11 lib/rest_model/serialization/integer.rb
rest_model-0.1.10 lib/rest_model/serialization/integer.rb