Sha256: 0e06b25faace471c489f7b46c9a65dffdc6467884c8147f7c819c5d80bad4c48

Contents?: true

Size: 374 Bytes

Versions: 4

Compression:

Stored size: 374 Bytes

Contents

module Cloudist
  module Encoding
    def encode(message)
      # Marshal.dump(message)
      # JSON.dump(message.to_hash)
      message.to_json
    end

    def decode(message)
      raise ArgumentError, "First argument can't be nil" if message.nil?
      return message unless message.is_a?(String)
      # Marshal.load(message)
      JSON.load(message)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cloudist-0.5.0 lib/cloudist/encoding.rb
cloudist-0.4.4 lib/cloudist/encoding.rb
cloudist-0.4.3 lib/cloudist/encoding.rb
cloudist-0.4.2 lib/cloudist/encoding.rb