json-rpc-objects 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{json-rpc-objects}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Martin Kozák"]
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require "json-rpc-objects/v20/response"
2
+ require "json-rpc-objects/v20/error"
3
3
 
4
4
  ##
5
5
  # Main JSON-RPC Objects module.
@@ -17,11 +17,11 @@ module JsonRpcObjects
17
17
  # Returns request of the latest standard.
18
18
  #
19
19
  # @param [Array] args for target constructor
20
- # @return [JsonRpcObjects::V11::Alt::Error] error object
20
+ # @return [JsonRpcObjects::V20::Error] error object
21
21
  #
22
22
 
23
23
  def self.create(*args)
24
- JsonRpcObjects::V11::Alt::Error::create(*args)
24
+ JsonRpcObjects::V20::Error::create(*args)
25
25
  end
26
26
 
27
27
  end
@@ -33,7 +33,18 @@ module JsonRpcObjects
33
33
  # @return [JsonRpcObjects::V10::Error] new object
34
34
  #
35
35
 
36
- def self.create(data)
36
+ def self.create(code, message = nil, opts = { })
37
+ if message.nil? and opts.empty?
38
+ data = code
39
+ elsif not opts.empty?
40
+ data = {
41
+ :message => message,
42
+ :data => opts
43
+ }
44
+ elsif
45
+ data = message
46
+ end
47
+
37
48
  self::new(data)
38
49
  end
39
50
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Martin Koz\xC3\xA1k"
@@ -207,7 +207,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
- hash: 759814957860137869
210
+ hash: 4360897851459333970
211
211
  segments:
212
212
  - 0
213
213
  version: "0"