cyrax 0.5.1.beta2 → 0.5.1.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/cyrax/response.rb +3 -2
- data/lib/cyrax/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTkyMDllMTAxNmM4NjU4YjkxZmJjYmVmN2RiNzVhNzhkN2UyZjMwYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTg2ZmRlYzljNmI5OGU3OTMwZTlhNmZkMTQxNDc4NDEyNTYxOWZlNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjNjYmNmOGQwNGM1OWYxZTJhYzJjYTA0NjVmZDQ2MzE5NTcxZjRhNGUxNDIw
|
10
|
+
ZWY1MzRlNmEzYzQ0OWYzYWVhNjQ0MjdhNDU3Y2VkMjdiYzhmMDVkY2U1ZmZh
|
11
|
+
Mzc0YjI0NmI3YTE2ZmEwODZmNDU3NzY0ZDY4N2FkNDAxM2YzY2I=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjkzZTY4NTdlOThlYzA1NmEwN2RjNzEyYWI5YmI4MzM5NzU5ZmUxNmYxNjJh
|
14
|
+
MTc2ZDU0MTAzOTM3OGE4NmQ5Zjg0OWNmYTcxNGQ0MjBiN2I4YjJkM2NhNGQ3
|
15
|
+
NzY0NTAwOGI0M2RjODgwY2NmYzUxNGM4N2EwNjc3MjM4ZDk0MmM=
|
data/lib/cyrax/response.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Cyrax::Response
|
2
2
|
attr_accessor :message, :errors, :status, :assignments,
|
3
|
-
:result, :resource_name, :options
|
3
|
+
:result, :resource_name, :options, :accessor
|
4
4
|
|
5
5
|
def initialize(resource_name, result, options = {})
|
6
6
|
@resource_name = resource_name
|
@@ -10,6 +10,7 @@ class Cyrax::Response
|
|
10
10
|
@errors = {}
|
11
11
|
@assignments = {}
|
12
12
|
@status = nil
|
13
|
+
@accessor = options[:as]
|
13
14
|
end
|
14
15
|
|
15
16
|
def with_errors(errors)
|
@@ -54,7 +55,7 @@ class Cyrax::Response
|
|
54
55
|
if failure?
|
55
56
|
{errors: @errors}
|
56
57
|
elsif options[:serializer]
|
57
|
-
options[:serializer].new(result).serialize
|
58
|
+
options[:serializer].new(result, as: accessor).serialize
|
58
59
|
else
|
59
60
|
result.as_json
|
60
61
|
end
|
data/lib/cyrax/version.rb
CHANGED