Sha256: bb1150ee47917fb4b070c077574d52e3f0fd7f8bcfe7a900e860db071b143a77
Contents?: true
Size: 564 Bytes
Versions: 18
Compression:
Stored size: 564 Bytes
Contents
class Card module Env # serializing environment (eg for delayed jobs) module Serialization SERIALIZABLE_ATTRIBUTES = ::Set.new %i[ main_name params ip ajax html host protocol salt ] # @param serialized_env [Hash] def with serialized_env tmp_env = serialize if @env @env ||= {} @env.update serialized_env yield ensure @env.update tmp_env if tmp_env end def serialize @env.select { |k, _v| SERIALIZABLE_ATTRIBUTES.include?(k) } end end end end
Version data entries
18 entries across 18 versions & 1 rubygems