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

Version Path
houston-core-0.9.2 lib/houston/params_serializer.rb
houston-core-0.9.1 lib/houston/params_serializer.rb
houston-core-0.9.0 lib/houston/params_serializer.rb
houston-core-0.9.0.rc1 lib/houston/params_serializer.rb
houston-core-0.8.4 lib/houston/params_serializer.rb
houston-core-0.8.3 lib/houston/params_serializer.rb
houston-core-0.8.2 lib/houston/params_serializer.rb
houston-core-0.8.1 lib/houston/params_serializer.rb
houston-core-0.8.0 lib/houston/params_serializer.rb
houston-core-0.8.0.pre2 lib/houston/params_serializer.rb
houston-core-0.8.0.pre lib/params_serializer.rb
houston-core-0.7.0 lib/params_serializer.rb
houston-core-0.7.0.beta4 lib/params_serializer.rb