Sha256: a1add2ba68eccf8ab594c2c4e77d7e77bd0155ab2d4a0150227db0c3dffb5817

Contents?: true

Size: 388 Bytes

Versions: 24

Compression:

Stored size: 388 Bytes

Contents

module SerializationHelper
  def serialize_body(object, protocol)
    if protocol == :msgpack
      MessagePack.pack(object)
    else
      JSON.dump(object)
    end
  end

  def deserialize_body(object, protocol)
    if protocol == :msgpack
      MessagePack.unpack(object)
    else
      JSON.parse(object)
    end
  end

  RSpec.configure do |config|
    config.include self
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
ably-rest-1.2.7 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.7 spec/support/serialization_helper.rb
ably-rest-1.2.6 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.6 spec/support/serialization_helper.rb
ably-rest-1.2.4 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.4 spec/support/serialization_helper.rb
ably-rest-1.2.3 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.3 spec/support/serialization_helper.rb
ably-rest-1.2.2 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.2 spec/support/serialization_helper.rb
ably-rest-1.2.1 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.1 spec/support/serialization_helper.rb
ably-rest-1.2.0 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.2.0 spec/support/serialization_helper.rb
ably-rest-1.1.8 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.1.8 spec/support/serialization_helper.rb
ably-rest-1.1.7 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.1.7 spec/support/serialization_helper.rb
ably-rest-1.1.6 lib/submodules/ably-ruby/spec/support/serialization_helper.rb
ably-1.1.6 spec/support/serialization_helper.rb