Sha256: de7cafbfa9034fd7aa96784329438f62fa75df652060229b0b6abffac7a92625

Contents?: true

Size: 981 Bytes

Versions: 3

Compression:

Stored size: 981 Bytes

Contents

# encoding: utf-8
# (c) 2011-2015 Martin Poljak (martin@poljak.cz)

$:.push("../../..")

#require "json-rpc-objects/serializer/marshal"
#JsonRpcObjects::default_serializer(JsonRpcObjects::Serializer::Marshal)


require "../error"
err = JsonRpcObjects::V20::Error::create(200, "some problem", :data => "Additional data.")

require "../response"
res = JsonRpcObjects::V20::Response::create(nil, err, :id => 12345)
puts res.serialize
res = JsonRpcObjects::V20::Response::create(true, nil, :id => 12345)
puts res.serialize

require "../request"
req = JsonRpcObjects::V20::Request::create(:alfa, [:beta], :"version" => :"1.0")
puts req.serialize
req = JsonRpcObjects::V20::Request::create(:alfa, {:alfa => :beta}, :id => :"12345", :$whatever => false)
puts req.serialize

require "../../request"
puts JsonRpcObjects::Request::parse(req.serialize).inspect
require "../../response"
puts JsonRpcObjects::Response::parse(res.serialize).inspect

puts req.class::version.response::create(25)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
json-rpc-objects-0.4.6 lib/json-rpc-objects/v20/tests/test.rb
json-rpc-objects-0.4.5 lib/json-rpc-objects/v20/tests/test.rb
json-rpc-objects-0.4.4 lib/json-rpc-objects/v20/tests/test.rb