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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 455d3b14051cc93b7ea272ca79f4bbdd039c52ae
4
- data.tar.gz: 59972d336a1e6cb1cff3c0b14f7da0434b3b7ad1
3
+ metadata.gz: bf7fd51c4148d4f6a5bf4eea255b56b5f77aeb7d
4
+ data.tar.gz: 1a46874b9ad497258d92ddb68446bc36586f6b8c
5
5
  SHA512:
6
- metadata.gz: 4863cfd3abd63d5efd19c54a7b8b734ae25a662cc3e6c5d5f0d8b87ae2fe648f7d3325e79a436fd49ca84e1102bbf4b26f90e45bf38e754ead646fd4968c4de6
7
- data.tar.gz: 78b333c4dfac5fa1f3114fe389f187e5ed8a6ff103fb01003fb2c512ca66358d13d4e8305c29634a1a9637b77919ef3050afc8637f792c6e83c3c7b728c2eace
6
+ metadata.gz: 1ded578e1288b063e668e1a96d455ac0888e19954858ca71dd930bd371c0bea5ad31e7c8c68a6db85b5a7f3ac2e762fe2cc10f03788f958d0b0b8f3d40806cff
7
+ data.tar.gz: 62a8a068ca0cf2db613b5c933d51926972818b9951dc9012ea4cae056a797810c54a3eb2fcae89534215a7829d61b211394dae2764533a0d0b0744dacdada24d
@@ -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.1
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-09 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel