namely 0.0.1 → 0.1.0

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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -24
  3. data/lib/namely.rb +2 -101
  4. data/lib/namely/authenticator.rb +61 -14
  5. data/lib/namely/collection.rb +78 -0
  6. data/lib/namely/connection.rb +90 -0
  7. data/lib/namely/exceptions.rb +0 -3
  8. data/lib/namely/model.rb +78 -0
  9. data/lib/namely/resource_gateway.rb +7 -2
  10. data/lib/namely/version.rb +1 -1
  11. data/spec/fixtures/vcr_cassettes/{country_head.yml → countries_head.yml} +4 -4
  12. data/spec/fixtures/vcr_cassettes/{country_head_missing.yml → countries_head_missing.yml} +4 -4
  13. data/spec/fixtures/vcr_cassettes/{country_index.yml → countries_index.yml} +6 -6
  14. data/spec/fixtures/vcr_cassettes/{country_show.yml → countries_show.yml} +4 -4
  15. data/spec/fixtures/vcr_cassettes/{country_show_missing.yml → countries_show_missing.yml} +7 -7
  16. data/spec/fixtures/vcr_cassettes/{currencytype_index.yml → currency_types_index.yml} +5 -5
  17. data/spec/fixtures/vcr_cassettes/current_user.yml +57 -0
  18. data/spec/fixtures/vcr_cassettes/{event_head.yml → events_head.yml} +4 -4
  19. data/spec/fixtures/vcr_cassettes/{event_head_missing.yml → events_head_missing.yml} +5 -5
  20. data/spec/fixtures/vcr_cassettes/events_index.yml +89 -0
  21. data/spec/fixtures/vcr_cassettes/{event_show.yml → events_show.yml} +5 -5
  22. data/spec/fixtures/vcr_cassettes/{event_show_missing.yml → events_show_missing.yml} +6 -6
  23. data/spec/fixtures/vcr_cassettes/fields_index.yml +48 -0
  24. data/spec/fixtures/vcr_cassettes/{jobtier_index.yml → job_tiers_index.yml} +5 -5
  25. data/spec/fixtures/vcr_cassettes/{field_index.yml → profiles/fields_index.yml} +5 -5
  26. data/spec/fixtures/vcr_cassettes/profiles_create.yml +85 -0
  27. data/spec/fixtures/vcr_cassettes/{profile_create_failed.yml → profiles_create_failed.yml} +9 -10
  28. data/spec/fixtures/vcr_cassettes/{profile_head.yml → profiles_head.yml} +4 -4
  29. data/spec/fixtures/vcr_cassettes/{profile_head_missing.yml → profiles_head_missing.yml} +4 -4
  30. data/spec/fixtures/vcr_cassettes/profiles_index.yml +981 -0
  31. data/spec/fixtures/vcr_cassettes/{profile_show.yml → profiles_show.yml} +4 -4
  32. data/spec/fixtures/vcr_cassettes/{profile_show_missing.yml → profiles_show_missing.yml} +7 -7
  33. data/spec/fixtures/vcr_cassettes/profiles_show_updated.yml +91 -0
  34. data/spec/fixtures/vcr_cassettes/profiles_update.yml +95 -0
  35. data/spec/fixtures/vcr_cassettes/profiles_update_revert.yml +95 -0
  36. data/spec/fixtures/vcr_cassettes/{report_head.yml → reports_head.yml} +4 -4
  37. data/spec/fixtures/vcr_cassettes/{report_head_missing.yml → reports_head_missing.yml} +5 -5
  38. data/spec/fixtures/vcr_cassettes/reports_show.yml +186 -0
  39. data/spec/fixtures/vcr_cassettes/{report_show_missing.yml → reports_show_missing.yml} +7 -7
  40. data/spec/fixtures/vcr_cassettes/token.yml +6 -6
  41. data/spec/namely/authenticator_spec.rb +36 -0
  42. data/spec/namely/connection_spec.rb +15 -0
  43. data/spec/namely/integration_spec.rb +94 -0
  44. data/spec/namely/resource_gateway_spec.rb +18 -10
  45. data/spec/shared_examples/a_resource_with_a_create_action.rb +24 -0
  46. data/spec/shared_examples/a_resource_with_a_show_action.rb +38 -0
  47. data/spec/shared_examples/a_resource_with_an_index_action.rb +15 -0
  48. data/spec/shared_examples/{a_model_with_an_update_action.rb → a_resource_with_an_update_action.rb} +10 -9
  49. data/spec/spec_helper.rb +0 -17
  50. metadata +75 -88
  51. data/lib/namely/country.rb +0 -9
  52. data/lib/namely/currency_type.rb +0 -9
  53. data/lib/namely/event.rb +0 -9
  54. data/lib/namely/field.rb +0 -9
  55. data/lib/namely/job_tier.rb +0 -9
  56. data/lib/namely/profile.rb +0 -13
  57. data/lib/namely/report.rb +0 -9
  58. data/lib/namely/restful_model.rb +0 -150
  59. data/spec/fixtures/vcr_cassettes/event_index.yml +0 -88
  60. data/spec/fixtures/vcr_cassettes/profile_create.yml +0 -85
  61. data/spec/fixtures/vcr_cassettes/profile_index.yml +0 -979
  62. data/spec/fixtures/vcr_cassettes/profile_show_updated.yml +0 -91
  63. data/spec/fixtures/vcr_cassettes/profile_update.yml +0 -95
  64. data/spec/fixtures/vcr_cassettes/profile_update_revert.yml +0 -95
  65. data/spec/fixtures/vcr_cassettes/report_show.yml +0 -185
  66. data/spec/namely/configuration_spec.rb +0 -33
  67. data/spec/namely/country_spec.rb +0 -11
  68. data/spec/namely/currency_type_spec.rb +0 -5
  69. data/spec/namely/event_spec.rb +0 -11
  70. data/spec/namely/field_spec.rb +0 -5
  71. data/spec/namely/job_tier_spec.rb +0 -5
  72. data/spec/namely/profile_spec.rb +0 -25
  73. data/spec/namely/report_spec.rb +0 -8
  74. data/spec/shared_examples/a_model_with_a_create_action.rb +0 -24
  75. data/spec/shared_examples/a_model_with_a_show_action.rb +0 -38
  76. data/spec/shared_examples/a_model_with_an_index_action.rb +0 -17
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: namely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Schwartz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backports
@@ -153,61 +153,52 @@ files:
153
153
  - Rakefile
154
154
  - lib/namely.rb
155
155
  - lib/namely/authenticator.rb
156
- - lib/namely/country.rb
157
- - lib/namely/currency_type.rb
158
- - lib/namely/event.rb
156
+ - lib/namely/collection.rb
157
+ - lib/namely/connection.rb
159
158
  - lib/namely/exceptions.rb
160
- - lib/namely/field.rb
161
- - lib/namely/job_tier.rb
162
- - lib/namely/profile.rb
163
- - lib/namely/report.rb
159
+ - lib/namely/model.rb
164
160
  - lib/namely/resource_gateway.rb
165
- - lib/namely/restful_model.rb
166
161
  - lib/namely/version.rb
167
162
  - namely.gemspec
168
- - spec/fixtures/vcr_cassettes/country_head.yml
169
- - spec/fixtures/vcr_cassettes/country_head_missing.yml
170
- - spec/fixtures/vcr_cassettes/country_index.yml
171
- - spec/fixtures/vcr_cassettes/country_show.yml
172
- - spec/fixtures/vcr_cassettes/country_show_missing.yml
173
- - spec/fixtures/vcr_cassettes/currencytype_index.yml
174
- - spec/fixtures/vcr_cassettes/event_head.yml
175
- - spec/fixtures/vcr_cassettes/event_head_missing.yml
176
- - spec/fixtures/vcr_cassettes/event_index.yml
177
- - spec/fixtures/vcr_cassettes/event_show.yml
178
- - spec/fixtures/vcr_cassettes/event_show_missing.yml
179
- - spec/fixtures/vcr_cassettes/field_index.yml
180
- - spec/fixtures/vcr_cassettes/jobtier_index.yml
181
- - spec/fixtures/vcr_cassettes/profile_create.yml
182
- - spec/fixtures/vcr_cassettes/profile_create_failed.yml
183
- - spec/fixtures/vcr_cassettes/profile_head.yml
184
- - spec/fixtures/vcr_cassettes/profile_head_missing.yml
185
- - spec/fixtures/vcr_cassettes/profile_index.yml
186
- - spec/fixtures/vcr_cassettes/profile_show.yml
187
- - spec/fixtures/vcr_cassettes/profile_show_missing.yml
188
- - spec/fixtures/vcr_cassettes/profile_show_updated.yml
189
- - spec/fixtures/vcr_cassettes/profile_update.yml
190
- - spec/fixtures/vcr_cassettes/profile_update_revert.yml
191
- - spec/fixtures/vcr_cassettes/report_head.yml
192
- - spec/fixtures/vcr_cassettes/report_head_missing.yml
193
- - spec/fixtures/vcr_cassettes/report_show.yml
194
- - spec/fixtures/vcr_cassettes/report_show_missing.yml
163
+ - spec/fixtures/vcr_cassettes/countries_head.yml
164
+ - spec/fixtures/vcr_cassettes/countries_head_missing.yml
165
+ - spec/fixtures/vcr_cassettes/countries_index.yml
166
+ - spec/fixtures/vcr_cassettes/countries_show.yml
167
+ - spec/fixtures/vcr_cassettes/countries_show_missing.yml
168
+ - spec/fixtures/vcr_cassettes/currency_types_index.yml
169
+ - spec/fixtures/vcr_cassettes/current_user.yml
170
+ - spec/fixtures/vcr_cassettes/events_head.yml
171
+ - spec/fixtures/vcr_cassettes/events_head_missing.yml
172
+ - spec/fixtures/vcr_cassettes/events_index.yml
173
+ - spec/fixtures/vcr_cassettes/events_show.yml
174
+ - spec/fixtures/vcr_cassettes/events_show_missing.yml
175
+ - spec/fixtures/vcr_cassettes/fields_index.yml
176
+ - spec/fixtures/vcr_cassettes/job_tiers_index.yml
177
+ - spec/fixtures/vcr_cassettes/profiles/fields_index.yml
178
+ - spec/fixtures/vcr_cassettes/profiles_create.yml
179
+ - spec/fixtures/vcr_cassettes/profiles_create_failed.yml
180
+ - spec/fixtures/vcr_cassettes/profiles_head.yml
181
+ - spec/fixtures/vcr_cassettes/profiles_head_missing.yml
182
+ - spec/fixtures/vcr_cassettes/profiles_index.yml
183
+ - spec/fixtures/vcr_cassettes/profiles_show.yml
184
+ - spec/fixtures/vcr_cassettes/profiles_show_missing.yml
185
+ - spec/fixtures/vcr_cassettes/profiles_show_updated.yml
186
+ - spec/fixtures/vcr_cassettes/profiles_update.yml
187
+ - spec/fixtures/vcr_cassettes/profiles_update_revert.yml
188
+ - spec/fixtures/vcr_cassettes/reports_head.yml
189
+ - spec/fixtures/vcr_cassettes/reports_head_missing.yml
190
+ - spec/fixtures/vcr_cassettes/reports_show.yml
191
+ - spec/fixtures/vcr_cassettes/reports_show_missing.yml
195
192
  - spec/fixtures/vcr_cassettes/token.yml
196
193
  - spec/fixtures/vcr_cassettes/token_refresh.yml
197
194
  - spec/namely/authenticator_spec.rb
198
- - spec/namely/configuration_spec.rb
199
- - spec/namely/country_spec.rb
200
- - spec/namely/currency_type_spec.rb
201
- - spec/namely/event_spec.rb
202
- - spec/namely/field_spec.rb
203
- - spec/namely/job_tier_spec.rb
204
- - spec/namely/profile_spec.rb
205
- - spec/namely/report_spec.rb
195
+ - spec/namely/connection_spec.rb
196
+ - spec/namely/integration_spec.rb
206
197
  - spec/namely/resource_gateway_spec.rb
207
- - spec/shared_examples/a_model_with_a_create_action.rb
208
- - spec/shared_examples/a_model_with_a_show_action.rb
209
- - spec/shared_examples/a_model_with_an_index_action.rb
210
- - spec/shared_examples/a_model_with_an_update_action.rb
198
+ - spec/shared_examples/a_resource_with_a_create_action.rb
199
+ - spec/shared_examples/a_resource_with_a_show_action.rb
200
+ - spec/shared_examples/a_resource_with_an_index_action.rb
201
+ - spec/shared_examples/a_resource_with_an_update_action.rb
211
202
  - spec/spec_helper.rb
212
203
  homepage: https://github.com/namely/ruby-client
213
204
  licenses:
@@ -234,47 +225,43 @@ signing_key:
234
225
  specification_version: 4
235
226
  summary: Wraps the Namely HTTP API in lovely Ruby.
236
227
  test_files:
237
- - spec/fixtures/vcr_cassettes/country_head.yml
238
- - spec/fixtures/vcr_cassettes/country_head_missing.yml
239
- - spec/fixtures/vcr_cassettes/country_index.yml
240
- - spec/fixtures/vcr_cassettes/country_show.yml
241
- - spec/fixtures/vcr_cassettes/country_show_missing.yml
242
- - spec/fixtures/vcr_cassettes/currencytype_index.yml
243
- - spec/fixtures/vcr_cassettes/event_head.yml
244
- - spec/fixtures/vcr_cassettes/event_head_missing.yml
245
- - spec/fixtures/vcr_cassettes/event_index.yml
246
- - spec/fixtures/vcr_cassettes/event_show.yml
247
- - spec/fixtures/vcr_cassettes/event_show_missing.yml
248
- - spec/fixtures/vcr_cassettes/field_index.yml
249
- - spec/fixtures/vcr_cassettes/jobtier_index.yml
250
- - spec/fixtures/vcr_cassettes/profile_create.yml
251
- - spec/fixtures/vcr_cassettes/profile_create_failed.yml
252
- - spec/fixtures/vcr_cassettes/profile_head.yml
253
- - spec/fixtures/vcr_cassettes/profile_head_missing.yml
254
- - spec/fixtures/vcr_cassettes/profile_index.yml
255
- - spec/fixtures/vcr_cassettes/profile_show.yml
256
- - spec/fixtures/vcr_cassettes/profile_show_missing.yml
257
- - spec/fixtures/vcr_cassettes/profile_show_updated.yml
258
- - spec/fixtures/vcr_cassettes/profile_update.yml
259
- - spec/fixtures/vcr_cassettes/profile_update_revert.yml
260
- - spec/fixtures/vcr_cassettes/report_head.yml
261
- - spec/fixtures/vcr_cassettes/report_head_missing.yml
262
- - spec/fixtures/vcr_cassettes/report_show.yml
263
- - spec/fixtures/vcr_cassettes/report_show_missing.yml
228
+ - spec/fixtures/vcr_cassettes/countries_head.yml
229
+ - spec/fixtures/vcr_cassettes/countries_head_missing.yml
230
+ - spec/fixtures/vcr_cassettes/countries_index.yml
231
+ - spec/fixtures/vcr_cassettes/countries_show.yml
232
+ - spec/fixtures/vcr_cassettes/countries_show_missing.yml
233
+ - spec/fixtures/vcr_cassettes/currency_types_index.yml
234
+ - spec/fixtures/vcr_cassettes/current_user.yml
235
+ - spec/fixtures/vcr_cassettes/events_head.yml
236
+ - spec/fixtures/vcr_cassettes/events_head_missing.yml
237
+ - spec/fixtures/vcr_cassettes/events_index.yml
238
+ - spec/fixtures/vcr_cassettes/events_show.yml
239
+ - spec/fixtures/vcr_cassettes/events_show_missing.yml
240
+ - spec/fixtures/vcr_cassettes/fields_index.yml
241
+ - spec/fixtures/vcr_cassettes/job_tiers_index.yml
242
+ - spec/fixtures/vcr_cassettes/profiles/fields_index.yml
243
+ - spec/fixtures/vcr_cassettes/profiles_create.yml
244
+ - spec/fixtures/vcr_cassettes/profiles_create_failed.yml
245
+ - spec/fixtures/vcr_cassettes/profiles_head.yml
246
+ - spec/fixtures/vcr_cassettes/profiles_head_missing.yml
247
+ - spec/fixtures/vcr_cassettes/profiles_index.yml
248
+ - spec/fixtures/vcr_cassettes/profiles_show.yml
249
+ - spec/fixtures/vcr_cassettes/profiles_show_missing.yml
250
+ - spec/fixtures/vcr_cassettes/profiles_show_updated.yml
251
+ - spec/fixtures/vcr_cassettes/profiles_update.yml
252
+ - spec/fixtures/vcr_cassettes/profiles_update_revert.yml
253
+ - spec/fixtures/vcr_cassettes/reports_head.yml
254
+ - spec/fixtures/vcr_cassettes/reports_head_missing.yml
255
+ - spec/fixtures/vcr_cassettes/reports_show.yml
256
+ - spec/fixtures/vcr_cassettes/reports_show_missing.yml
264
257
  - spec/fixtures/vcr_cassettes/token.yml
265
258
  - spec/fixtures/vcr_cassettes/token_refresh.yml
266
259
  - spec/namely/authenticator_spec.rb
267
- - spec/namely/configuration_spec.rb
268
- - spec/namely/country_spec.rb
269
- - spec/namely/currency_type_spec.rb
270
- - spec/namely/event_spec.rb
271
- - spec/namely/field_spec.rb
272
- - spec/namely/job_tier_spec.rb
273
- - spec/namely/profile_spec.rb
274
- - spec/namely/report_spec.rb
260
+ - spec/namely/connection_spec.rb
261
+ - spec/namely/integration_spec.rb
275
262
  - spec/namely/resource_gateway_spec.rb
276
- - spec/shared_examples/a_model_with_a_create_action.rb
277
- - spec/shared_examples/a_model_with_a_show_action.rb
278
- - spec/shared_examples/a_model_with_an_index_action.rb
279
- - spec/shared_examples/a_model_with_an_update_action.rb
263
+ - spec/shared_examples/a_resource_with_a_create_action.rb
264
+ - spec/shared_examples/a_resource_with_a_show_action.rb
265
+ - spec/shared_examples/a_resource_with_an_index_action.rb
266
+ - spec/shared_examples/a_resource_with_an_update_action.rb
280
267
  - spec/spec_helper.rb
@@ -1,9 +0,0 @@
1
- module Namely
2
- class Country < RestfulModel
3
- def self.endpoint
4
- "countries"
5
- end
6
-
7
- private_class_method :endpoint
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Namely
2
- class CurrencyType < RestfulModel
3
- def self.endpoint
4
- "currency_types"
5
- end
6
-
7
- private_class_method :endpoint
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Namely
2
- class Event < RestfulModel
3
- def self.endpoint
4
- "events"
5
- end
6
-
7
- private_class_method :endpoint
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Namely
2
- class Field < RestfulModel
3
- def self.endpoint
4
- "profiles/fields"
5
- end
6
-
7
- private_class_method :endpoint, :resource_name
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- module Namely
2
- class JobTier < RestfulModel
3
- def self.endpoint
4
- "job_tiers"
5
- end
6
-
7
- private_class_method :endpoint
8
- end
9
- end
@@ -1,13 +0,0 @@
1
- module Namely
2
- class Profile < RestfulModel
3
- def self.endpoint
4
- "profiles"
5
- end
6
-
7
- def required_keys_for_update
8
- [:email]
9
- end
10
-
11
- private_class_method :endpoint, :resource_name
12
- end
13
- end
@@ -1,9 +0,0 @@
1
- module Namely
2
- class Report < RestfulModel
3
- def self.endpoint
4
- "reports"
5
- end
6
-
7
- private_class_method :endpoint
8
- end
9
- end
@@ -1,150 +0,0 @@
1
- module Namely
2
- # @abstract
3
- class RestfulModel < OpenStruct
4
- # Fetch a model from the server by its ID.
5
- #
6
- # @param [#to_s] id
7
- #
8
- # @raise [NoSuchModelError] if the model wasn't found.
9
- #
10
- # @return [RestfulModel]
11
- def self.find(id)
12
- new(resource_gateway.json_show(id))
13
- rescue RestClient::ResourceNotFound
14
- raise NoSuchModelError, "Can't find a #{name} with id \"#{id}\""
15
- end
16
-
17
- # Returns true if a model with this ID exists, false otherwise.
18
- #
19
- # @param [#to_s] id
20
- #
21
- # @return [Boolean]
22
- def self.exists?(id)
23
- resource_gateway.show_head(id)
24
- true
25
- rescue RestClient::ResourceNotFound
26
- false
27
- end
28
-
29
- # Return every instance of this model.
30
- #
31
- # A model might have quite a few instances. If this is the case,
32
- # the query may take some time (several seconds) and the resulting
33
- # array may be very large.
34
- #
35
- # @return [Array<RestfulModel>]
36
- def self.all
37
- resource_gateway.json_index.map { |model| new(model) }
38
- end
39
-
40
- # Create a new model on the server with the given attributes.
41
- #
42
- # @param [Hash] attributes the attributes of the model being created.
43
- #
44
- # @example
45
- # Profile.create!(
46
- # first_name: "Beardsly",
47
- # last_name: "McDog",
48
- # email: "beardsly@namely.com"
49
- # )
50
- #
51
- # @return [RestfulModel] the created model.
52
- def self.create!(attributes)
53
- new(attributes).save!
54
- end
55
-
56
- # Update the attributes of this model. Assign the attributes
57
- # according to the hash, then persist those changes on the server.
58
- #
59
- # @param [Hash] attributes the attributes to be updated on the model.
60
- #
61
- # @example
62
- # my_profile.update(
63
- # middle_name: "Ludwig"
64
- # )
65
- #
66
- # @raise [FailedRequestError] if the request failed for any reason.
67
- #
68
- # @return [RestfulModel] the updated model.
69
- def update(attributes)
70
- attributes.each do |key, value|
71
- self[key] = value
72
- end
73
-
74
- persist_model_changes(attributes)
75
-
76
- self
77
- end
78
-
79
- # Try to persist the current object, either by creating a new
80
- # object on the server or by updating an existing one. Raise an
81
- # error if the object can't be saved.
82
- #
83
- # @raise [FailedRequestError] if the request failed for any reason.
84
- #
85
- # @return [RestfulModel] the model itself, if saving succeeded.
86
- def save!
87
- if persisted?
88
- update(to_h)
89
- else
90
- self.id = resource_gateway.create(to_h)
91
- end
92
- self
93
- rescue RestClient::Exception => e
94
- raise FailedRequestError, e.message
95
- end
96
-
97
- # Return true if the model exists (in some state) on the server.
98
- #
99
- # @return [Boolean]
100
- def persisted?
101
- !!id
102
- end
103
-
104
- private
105
-
106
- def resource_gateway
107
- self.class.resource_gateway
108
- end
109
-
110
- def self.resource_gateway
111
- Namely.resource_gateway(resource_name, endpoint)
112
- end
113
-
114
- def resource_gateway
115
- self.class.resource_gateway
116
- end
117
-
118
- def self.endpoint
119
- raise(
120
- NotImplementedError,
121
- "Namely::Model subclasses must define an `.endpoint` "\
122
- "class method that returns their path in the API."
123
- )
124
- end
125
-
126
- def self.resource_name
127
- endpoint.split("/").last
128
- end
129
-
130
- # The update action for certain models requires populating certain
131
- # fields. Without populating these fields, an update with
132
- # fail. This method is intended to be overwritten by subclasses
133
- # with required keys.
134
- #
135
- # @return [Array<Symbol>]
136
- def required_keys_for_update
137
- []
138
- end
139
-
140
- def required_attributes_for_update
141
- to_h.select { |key, _| required_keys_for_update.include?(key) }
142
- end
143
-
144
- def persist_model_changes(changed_attributes)
145
- resource_gateway.update(id, changed_attributes.merge(required_attributes_for_update))
146
- rescue RestClient::Exception => e
147
- raise FailedRequestError, e.message
148
- end
149
- end
150
- end
@@ -1,88 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://<TEST_SUBDOMAIN>.namely.com/api/v1/events?access_token=<TEST_ACCESS_TOKEN>&limit=all
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - application/json
12
- Accept-Encoding:
13
- - gzip, deflate
14
- User-Agent:
15
- - Ruby
16
- response:
17
- status:
18
- code: 200
19
- message: OK
20
- headers:
21
- Cache-Control:
22
- - max-age=0, private, must-revalidate
23
- Content-Encoding:
24
- - gzip
25
- Content-Type:
26
- - application/json; charset=utf-8
27
- Date:
28
- - Tue, 04 Nov 2014 16:34:37 GMT
29
- Server:
30
- - nginx
31
- Status:
32
- - 200 OK
33
- Strict-Transport-Security:
34
- - max-age=31536000
35
- - max-age=31536000; includeSubDomains;
36
- Vary:
37
- - Accept-Encoding
38
- X-Rack-Cache:
39
- - miss
40
- X-Request-Id:
41
- - 5633b619-a52c-44be-9128-c136d0b907a1
42
- X-Runtime:
43
- - '0.090776'
44
- Content-Length:
45
- - '1569'
46
- Connection:
47
- - keep-alive
48
- body:
49
- encoding: ASCII-8BIT
50
- string: !binary |-
51
- H4sIAAAAAAAAA9VZ224bNxD9FUEvfQkT3i9+a5GiQIqgRa9Ag8IYkkNHjbQr
52
- rNZOhcD/3llbvlQWmmkaAeqLIVM8u2fODmfOrD7M8Qq7cTM/e/Nhvqjzs3lI
53
- 0EzNWmDITtgERYBvUuhkfTAQolEwfzZ/O2Cj3S9u4S+YqHG7RkINWAh1DsOw
54
- uIIlrZcBYcR6DuP8TFnllLJeS1rvu5F2zs+6y+WSbjqulud7a1uEYUNAWl+t
55
- odverV9ucFpa3UY3DpdIl4Pubm1+1mC52a1V3IxDv73btlx07wjzYb4e+rZY
56
- TowlKp+VNqKUaoRFK0VCqALA+mghqabbFMf9Dd/8/mx+i53oXF8/28mr0NJm
57
- b0VMzgsbQiShihLgdFLVqYogn8rLRO3kha5bXOGwgWF7QFuZlLfxE7VVn1vY
58
- 6MAldCBUaEVYMEaAbE5AU7pVDCkGyxI262i9MVGUqKKwORmRPETRMEOC1HTI
59
- B/KWifofCiu1DhEUCFsa0h8ZRI6AIitQIXqbnS8sYaFlk401QnmdhVUYKfWd
60
- FFLZCilICZifCstE7YTNi2F8W+GAqjbqGNUplYLgDMgIXvhkqrAeSVhDyeOq
61
- A9ukMyUrlrBap2p9NiLLRDUzRKqZoUiRm9HV5mKcck+FZaKYlZbw2kl3QvI2
62
- 4mNj8yIkQwUhUyeJaKswMsToTYktBZa86FwwPkVhkrFUWXITKZUmXKAWpX2l
63
- 0NNTeZkotrw+RnNK2VsaeBO0E9JqKWw0TtD5oipRXXJI9TYDr966EsFKH0Q0
64
- ieAug8heJqFd0RkNOBMP1Fsmii+vT0qfkLxQJaYQlIgVpuzVKKItILQ2oNBR
65
- j6u8qmujm5ofiuYwT+WbDAe5KAFWJZeihwr4VF4mitPObLDamk+tDPZzC1tb
66
- cLJRK/FYyAFFp0Wy1NM09TOrgsnVIEtYU2XOgQxHdZEOuLMoICf6VFSrgU49
67
- PaKnwjJR3Lz1E3f1idoeI29NKEkl1KKpMvkgyp6sqhVkgowvpVAR4+Vtdd5W
68
- TfVFZ6mFlehExpiEw1hz8ipWdaDqMlF8eXXU4YTkbZaaszNITS3Q+FBcI+se
69
- vKDAHNW9YJX0LHmRnkyVVQrTbrqjIqEUXag4rBR3M6kdamo8FFvemKQyJyRv
70
- odpavFFCVU/yxlIFWV8rvLYpI3lPrLymlsgmA1JnakVSlfFVTTaLpoNQDHkP
71
- mmbLgemMieLLG9xJyZuVAjK1VbQgJ6dAY35yNVF8TWpHY1rUPMdrPfXCmJ2o
72
- eiriMtKcZ900mEztUrnW2qGmxkPx5aX8Panaizb6JKOoRpO8eTLz3oCYaqKj
73
- CkgjkGPJm2yNpUzKaBq3LFbyrjTSCl3oDIRgvZf2QPbyUP9GXpdOSF6dtKa5
74
- nqwCZHK8WAqN+IZqb1Mem6aR7aZ1f1xeH7EZk8mCwI0FmV7CGDoQpiBm48Bg
75
- iU/lZaL+hbw0gZyQvC5YKZ2rwrtpHjXUYGheN6Ig9ZVAtiz6f85e+neFI0xX
76
- HXCz7rsNfaWlPEx0WrtcV9Jk80C0v5xoK3f9iOGt/M/viX64k3i3spnT7t2m
77
- h5vc77pfeti1d537i9xt/ci9dp+fL1ZwceA6O+5YH8m7eXgty5T5LvnW2K+X
78
- +IKJavQgzjtYTXS+oqypm+V29rq87C/oyz/6fD4uxiXe/qUtP3fvuv59N3vV
79
- 59lPN2uPdN+F9/ejwzyDe+yZqKOzZxboPfZM1NHZM7v3Hnsm6ujsmdZujz0T
80
- dXT2TN+/x56JOjp75lC4n/c81GP2r6n+b7bdCGVclNkvMCwg3/D7HFEwX8ns
81
- RcFEHf0ZMN/X7ec/D3V09syXufv5z0MdnT3zR7899kzUY/bfYD9c4OyroS/v
82
- lvj2ctiMB0P4stxYndnXf2K5HBdXjBB4vwLth8BDPQ7hFawWOPsNVm1BLq5c
83
- fqZHwPyxZY8/E/WY//cwDovybvYSV+sNbg/S/wEvFn0Hy9mPQN5s9ho6Yjx8
84
- NAbmq8u9GJioxzF8i8Ownf0Km7eL7mLsu4NB/Ni38T0MSJFe4bJfMwJg/ka7
85
- FwAT9bdzALkfZt998fL99obWf8mg3w/NHDcfr6//Ag63iAb2IAAA
86
- http_version:
87
- recorded_at: Tue, 04 Nov 2014 16:34:37 GMT
88
- recorded_with: VCR 2.9.3