Sha256: 1f176de521b87962b7257c2a6e9b8688e3b8fbaadac2e0978bed89603fc973b2

Contents?: true

Size: 364 Bytes

Versions: 7

Compression:

Stored size: 364 Bytes

Contents

class RestModel
  module Serialization
    class Integer
      def self.serialize(value)
        Integer(value)
      rescue ArgumentError
        raise "value not serializable: #{value}"
      end

      def self.desserialize(value)
        Integer(value)
      rescue ArgumentError
        raise "value not desserializable: #{value}"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rest_model-0.1.6 lib/rest_model/serialization/integer.rb
rest_model-0.1.5 lib/rest_model/serialization/integer.rb
rest_model-0.1.4 lib/rest_model/serialization/integer.rb
rest_model-0.1.3 lib/rest_model/serialization/integer.rb
rest_model-0.1.2 lib/rest_model/serialization/integer.rb
rest_model-0.1.1 lib/rest_model/serialization/integer.rb
rest_model-0.1.0 lib/rest_model/serialization/integer.rb