api-model 2.0.1 → 2.1.0

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: 441ff23f2ba1d0707bea80f456c2caf35c41dc54
4
- data.tar.gz: ed85061b54a94ec9926fc751cdf463d4375f8ec5
3
+ metadata.gz: 4429aa28093885e9a1fe8ec0c21640866b2c9681
4
+ data.tar.gz: 3a049bf4664ea95bf7510c8f925ef3a5d9a2152c
5
5
  SHA512:
6
- metadata.gz: b3e73a8350c7cd81d6ac243df0b730787fad37bf0d37fa31e7a9b2c4a3342fd8b00911f50edd2b6abbb0e02cab9b38c033faab27d45498e219db6a4866e3be47
7
- data.tar.gz: 37c55e14a6d3d580a91904737155964388759c96d5d858b2cf063c1be4bd09825024da52b7f9207beb249e26917f69267d37c75bc95d0d6778957f6dfa0450bc
6
+ metadata.gz: 4446f3269d881f915a7f0834d7c887811c1d3f346b7f06d598295495d16d988930355786b17d77aec397063a812fbe1010be42a05a6a7baa43419d71703b826b
7
+ data.tar.gz: 1419d5dd05f5e6779fe3beed226aa4bcb2ada6d3e76905f1ae48f414d84d0545a970e48cf9d739daaf039a994168b2bd6754f16f290bd3dc7ab0b5f7782ad7a4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api-model (2.0.1)
4
+ api-model (2.1.0)
5
5
  activemodel (~> 4.1)
6
6
  activesupport (~> 4.1)
7
7
  hash-pipe (~> 0.0)
@@ -38,13 +38,13 @@ GEM
38
38
  ethon (0.7.0)
39
39
  ffi (>= 1.3.0)
40
40
  ffi (1.9.3)
41
- hash-pipe (0.0.1)
42
- activesupport (~> 4.0)
41
+ hash-pipe (0.0.2)
42
+ activesupport (~> 4.1)
43
43
  i18n (0.6.9)
44
44
  ice_nine (0.11.0)
45
45
  json (1.8.1)
46
46
  method_source (0.8.2)
47
- minitest (5.3.2)
47
+ minitest (5.3.3)
48
48
  pry (0.9.12.2)
49
49
  coderay (~> 1.0.5)
50
50
  method_source (~> 0.8)
data/api-model.gemspec CHANGED
@@ -2,9 +2,9 @@ $:.push File.expand_path("../lib", __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "api-model"
5
- s.version = "2.0.1"
6
- s.authors = ["Damien Timewell"]
7
- s.email = ["mail@damientimewell.com"]
5
+ s.version = "2.1.0"
6
+ s.authors = ["Damien Timewell", "Erik Rothoff Andersson"]
7
+ s.email = ["mail@damientimewell.com", "erik.rothoff@gmail.com"]
8
8
  s.licenses = ['MIT']
9
9
  s.homepage = "https://github.com/iZettle/api-model"
10
10
  s.summary = "A simple way of interacting with rest APIs"
@@ -6,7 +6,12 @@ module ApiModel
6
6
  extend ActiveModel::Callbacks
7
7
  define_model_callbacks :save, :successful_save, :unsuccessful_save, :initialize
8
8
 
9
- attribute :persisted, Axiom::Types::Boolean, default: false
9
+ attr_writer :persisted
10
+
11
+ def persisted
12
+ @persisted || false
13
+ end
14
+
10
15
  alias_method :persisted?, :persisted
11
16
  end
12
17
 
@@ -72,7 +77,8 @@ module ApiModel
72
77
  #
73
78
  # This is useful for when you need to pass the entire object back to an API, or if you want to serialize the object.
74
79
  def properties_hash
75
- self.to_hash.only(*self.class.attribute_set.collect(&:name)).except(:persisted).with_indifferent_access
80
+ ActiveSupport::Deprecation.warn "properties_hash() is deprecated and may be removed from future releases, use as_json() instead.", caller
81
+ self.as_json.with_indifferent_access
76
82
  end
77
83
 
78
84
  end
metadata CHANGED
@@ -1,111 +1,112 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Timewell
8
+ - Erik Rothoff Andersson
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-04-16 00:00:00.000000000 Z
12
+ date: 2014-04-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activesupport
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - "~>"
18
+ - - ~>
18
19
  - !ruby/object:Gem::Version
19
20
  version: '4.1'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - "~>"
25
+ - - ~>
25
26
  - !ruby/object:Gem::Version
26
27
  version: '4.1'
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: activemodel
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - "~>"
32
+ - - ~>
32
33
  - !ruby/object:Gem::Version
33
34
  version: '4.1'
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - "~>"
39
+ - - ~>
39
40
  - !ruby/object:Gem::Version
40
41
  version: '4.1'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: typhoeus
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
- - - "~>"
46
+ - - ~>
46
47
  - !ruby/object:Gem::Version
47
48
  version: '0.6'
48
49
  type: :runtime
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - "~>"
53
+ - - ~>
53
54
  - !ruby/object:Gem::Version
54
55
  version: '0.6'
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: virtus
57
58
  requirement: !ruby/object:Gem::Requirement
58
59
  requirements:
59
- - - "~>"
60
+ - - ~>
60
61
  - !ruby/object:Gem::Version
61
62
  version: '1.0'
62
63
  type: :runtime
63
64
  prerelease: false
64
65
  version_requirements: !ruby/object:Gem::Requirement
65
66
  requirements:
66
- - - "~>"
67
+ - - ~>
67
68
  - !ruby/object:Gem::Version
68
69
  version: '1.0'
69
70
  - !ruby/object:Gem::Dependency
70
71
  name: hash-pipe
71
72
  requirement: !ruby/object:Gem::Requirement
72
73
  requirements:
73
- - - "~>"
74
+ - - ~>
74
75
  - !ruby/object:Gem::Version
75
76
  version: '0.0'
76
77
  type: :runtime
77
78
  prerelease: false
78
79
  version_requirements: !ruby/object:Gem::Requirement
79
80
  requirements:
80
- - - "~>"
81
+ - - ~>
81
82
  - !ruby/object:Gem::Version
82
83
  version: '0.0'
83
84
  - !ruby/object:Gem::Dependency
84
85
  name: rspec
85
86
  requirement: !ruby/object:Gem::Requirement
86
87
  requirements:
87
- - - "~>"
88
+ - - ~>
88
89
  - !ruby/object:Gem::Version
89
90
  version: '2.14'
90
91
  type: :development
91
92
  prerelease: false
92
93
  version_requirements: !ruby/object:Gem::Requirement
93
94
  requirements:
94
- - - "~>"
95
+ - - ~>
95
96
  - !ruby/object:Gem::Version
96
97
  version: '2.14'
97
98
  - !ruby/object:Gem::Dependency
98
99
  name: pry
99
100
  requirement: !ruby/object:Gem::Requirement
100
101
  requirements:
101
- - - "~>"
102
+ - - ~>
102
103
  - !ruby/object:Gem::Version
103
104
  version: '0.9'
104
105
  type: :development
105
106
  prerelease: false
106
107
  version_requirements: !ruby/object:Gem::Requirement
107
108
  requirements:
108
- - - "~>"
109
+ - - ~>
109
110
  - !ruby/object:Gem::Version
110
111
  version: '0.9'
111
112
  - !ruby/object:Gem::Dependency
@@ -141,13 +142,14 @@ description: API model is a simple wrapper for interacting with external APIs. I
141
142
  objects.
142
143
  email:
143
144
  - mail@damientimewell.com
145
+ - erik.rothoff@gmail.com
144
146
  executables: []
145
147
  extensions: []
146
148
  extra_rdoc_files: []
147
149
  files:
148
- - ".gitignore"
149
- - ".rspec"
150
- - ".travis.yml"
150
+ - .gitignore
151
+ - .rspec
152
+ - .travis.yml
151
153
  - Gemfile
152
154
  - Gemfile.lock
153
155
  - README.md
@@ -189,17 +191,17 @@ require_paths:
189
191
  - lib
190
192
  required_ruby_version: !ruby/object:Gem::Requirement
191
193
  requirements:
192
- - - ">="
194
+ - - '>='
193
195
  - !ruby/object:Gem::Version
194
196
  version: '0'
195
197
  required_rubygems_version: !ruby/object:Gem::Requirement
196
198
  requirements:
197
- - - ">="
199
+ - - '>='
198
200
  - !ruby/object:Gem::Version
199
201
  version: '0'
200
202
  requirements: []
201
203
  rubyforge_project:
202
- rubygems_version: 2.2.2
204
+ rubygems_version: 2.1.11
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: A simple way of interacting with rest APIs