wamp_client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +464 -0
- data/Rakefile +3 -0
- data/circle.yml +3 -0
- data/lib/wamp_client/auth.rb +18 -0
- data/lib/wamp_client/check.rb +57 -0
- data/lib/wamp_client/connection.rb +194 -0
- data/lib/wamp_client/message.rb +1283 -0
- data/lib/wamp_client/serializer.rb +40 -0
- data/lib/wamp_client/session.rb +776 -0
- data/lib/wamp_client/transport.rb +129 -0
- data/lib/wamp_client/version.rb +3 -0
- data/lib/wamp_client.rb +7 -0
- data/scripts/gen_message.rb +537 -0
- data/spec/auth_spec.rb +18 -0
- data/spec/check_spec.rb +197 -0
- data/spec/message_spec.rb +1478 -0
- data/spec/session_spec.rb +1004 -0
- data/spec/spec_helper.rb +43 -0
- data/tasks/rspec.rake +3 -0
- data/wamp_client.gemspec +29 -0
- metadata +170 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module WampClient
|
4
|
+
module Serializer
|
5
|
+
class Base
|
6
|
+
|
7
|
+
attr_accessor :type
|
8
|
+
|
9
|
+
# Serializes the object
|
10
|
+
# @param object - The object to serialize
|
11
|
+
def serialize(object)
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
# Deserializes the object
|
16
|
+
# @param string [String] - The string to deserialize
|
17
|
+
# @return The deserialized object
|
18
|
+
def deserialize(string)
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
class JSONSerializer < Base
|
25
|
+
|
26
|
+
def initialize
|
27
|
+
self.type = 'json'
|
28
|
+
end
|
29
|
+
|
30
|
+
def serialize(object)
|
31
|
+
JSON.generate object
|
32
|
+
end
|
33
|
+
|
34
|
+
def deserialize(string)
|
35
|
+
JSON.parse(string, {:symbolize_names => true})
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|