rightresource 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ require 'logger'
4
4
  require 'pp'
5
5
  require 'rubygems'
6
6
 
7
- require 'json'
7
+ require 'json/pure'
8
8
  require 'rest_client'
9
9
  require 'crack'
10
10
 
@@ -38,6 +38,6 @@ require 'right_resource/macro'
38
38
  require 'right_resource/credential'
39
39
 
40
40
  module RightResource
41
- VERSION = '0.3.1'
41
+ VERSION = '0.3.2'
42
42
  API_VERSION = "1.0"
43
43
  end
@@ -343,10 +343,10 @@ module RightResource
343
343
  @attributes = {}
344
344
  load_attributes(attributes)
345
345
  if @attributes
346
- if self.class.resource_id.nil?
347
- @id = @attributes[:href].match(/\d+$/).to_s if @attributes[:href]
348
- else
346
+ if self.class.resource_id && self.class.status_code == 201
349
347
  @id = self.class.resource_id
348
+ else
349
+ @id = @attributes[:href].match(/\d+$/).to_s if @attributes[:href]
350
350
  end
351
351
  load_accessor(@attributes)
352
352
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rightresource
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Satoshi Ohki