Sha256: 46fb94126b84b8c9f6494cae15235370ff493c4633715f861cf5b6d6ce53b911

Contents?: true

Size: 418 Bytes

Versions: 3

Compression:

Stored size: 418 Bytes

Contents

module Hari
  class Entity
    module Serialization
      module Integer

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

        def self.desserialize(value, options = {})
          return unless value

          Integer value
        rescue
          raise SerializationError, "#{options[:name]}:#{value} is not an integer"
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hari-0.0.5 lib/hari/entity/serialization/integer.rb
hari-0.0.4 lib/hari/entity/serialization/integer.rb
hari-0.0.3 lib/hari/entity/serialization/integer.rb