protip 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protip/resource.rb +4 -2
- data/test/unit/protip/resource_test.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf7fd51c4148d4f6a5bf4eea255b56b5f77aeb7d
|
4
|
+
data.tar.gz: 1a46874b9ad497258d92ddb68446bc36586f6b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ded578e1288b063e668e1a96d455ac0888e19954858ca71dd930bd371c0bea5ad31e7c8c68a6db85b5a7f3ac2e762fe2cc10f03788f958d0b0b8f3d40806cff
|
7
|
+
data.tar.gz: 62a8a068ca0cf2db613b5c933d51926972818b9951dc9012ea4cae056a797810c54a3eb2fcae89534215a7829d61b211394dae2764533a0d0b0744dacdada24d
|
data/lib/protip/resource.rb
CHANGED
@@ -108,16 +108,18 @@ module Protip
|
|
108
108
|
# you're working with.
|
109
109
|
module ExtraMethods
|
110
110
|
def self.member(resource, action, method, message, response_type)
|
111
|
-
resource.class.client.request path: "#{resource.class.base_path}/#{resource.id}/#{action}",
|
111
|
+
response = resource.class.client.request path: "#{resource.class.base_path}/#{resource.id}/#{action}",
|
112
112
|
method: method,
|
113
113
|
message: message,
|
114
114
|
response_type: response_type
|
115
|
+
nil == response ? nil : ::Protip::Wrapper.new(response, resource.class.converter)
|
115
116
|
end
|
116
117
|
def self.collection(resource_class, action, method, message, response_type)
|
117
|
-
resource_class.client.request path: "#{resource_class.base_path}/#{action}",
|
118
|
+
response = resource_class.client.request path: "#{resource_class.base_path}/#{action}",
|
118
119
|
method: method,
|
119
120
|
message: message,
|
120
121
|
response_type: response_type
|
122
|
+
nil == response ? nil : ::Protip::Wrapper.new(response, resource_class.converter)
|
121
123
|
end
|
122
124
|
end
|
123
125
|
|
@@ -699,9 +699,9 @@ module Protip::ResourceTest # Namespace for internal constants
|
|
699
699
|
target.action
|
700
700
|
end
|
701
701
|
|
702
|
-
it 'returns the server response' do
|
702
|
+
it 'returns the wrapped server response' do
|
703
703
|
client.stubs(:request).returns(response)
|
704
|
-
assert_equal response, target.action
|
704
|
+
assert_equal Protip::Wrapper.new(response, resource_class.converter), target.action
|
705
705
|
end
|
706
706
|
end
|
707
707
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AngelList
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|