Sha256: 5c47bcba4df7b4de18d473cd5543d7f6d0c9add28e9bf09cca1f96099d5f44c1
Contents?: true
Size: 424 Bytes
Versions: 13
Compression:
Stored size: 424 Bytes
Contents
require "houston/boot/serializer" module Houston class ParamsSerializer < Serializer def load(string) super(string || "{}") end def dump(object) object = {} if object.nil? object = object.to_h if !object.is_a?(Hash) && object.respond_to?(:to_h) raise ArgumentError, "params must be a Hash, but it is a #{object.class}" unless object.is_a?(Hash) super object end end end
Version data entries
13 entries across 13 versions & 1 rubygems