foreman_webhooks 3.2.3 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_webhooks/locale/ca/foreman_webhooks.js +39 -0
  3. data/app/assets/javascripts/foreman_webhooks/locale/cs_CZ/foreman_webhooks.js +39 -0
  4. data/app/assets/javascripts/foreman_webhooks/locale/de/foreman_webhooks.js +39 -0
  5. data/app/assets/javascripts/foreman_webhooks/locale/en/foreman_webhooks.js +15 -0
  6. data/app/assets/javascripts/foreman_webhooks/locale/en_GB/foreman_webhooks.js +39 -0
  7. data/app/assets/javascripts/foreman_webhooks/locale/es/foreman_webhooks.js +39 -0
  8. data/app/assets/javascripts/foreman_webhooks/locale/fr/foreman_webhooks.js +39 -0
  9. data/app/assets/javascripts/foreman_webhooks/locale/it/foreman_webhooks.js +39 -0
  10. data/app/assets/javascripts/foreman_webhooks/locale/ja/foreman_webhooks.js +39 -0
  11. data/app/assets/javascripts/foreman_webhooks/locale/ka/foreman_webhooks.js +39 -0
  12. data/app/assets/javascripts/foreman_webhooks/locale/ko/foreman_webhooks.js +39 -0
  13. data/app/assets/javascripts/foreman_webhooks/locale/pl/foreman_webhooks.js +39 -0
  14. data/app/assets/javascripts/foreman_webhooks/locale/pt_BR/foreman_webhooks.js +39 -0
  15. data/app/assets/javascripts/foreman_webhooks/locale/ru/foreman_webhooks.js +39 -0
  16. data/app/assets/javascripts/foreman_webhooks/locale/zh_CN/foreman_webhooks.js +39 -0
  17. data/app/assets/javascripts/foreman_webhooks/locale/zh_TW/foreman_webhooks.js +39 -0
  18. data/app/lib/foreman_webhooks/renderer/scope/webhook_template.rb +5 -2
  19. data/db/migrate/20201014115147_rename_ca_file_column.rb +1 -1
  20. data/lib/foreman_webhooks/engine.rb +62 -62
  21. data/lib/foreman_webhooks/version.rb +1 -1
  22. data/locale/ca/foreman_webhooks.po +39 -1
  23. data/locale/cs_CZ/foreman_webhooks.po +39 -1
  24. data/locale/de/foreman_webhooks.po +39 -1
  25. data/locale/en/foreman_webhooks.po +15 -0
  26. data/locale/en_GB/foreman_webhooks.po +39 -1
  27. data/locale/es/foreman_webhooks.po +39 -1
  28. data/locale/fr/foreman_webhooks.po +39 -1
  29. data/locale/it/foreman_webhooks.po +39 -1
  30. data/locale/ja/foreman_webhooks.po +39 -1
  31. data/locale/ka/foreman_webhooks.po +39 -1
  32. data/locale/ko/foreman_webhooks.po +39 -1
  33. data/locale/pl/foreman_webhooks.po +39 -1
  34. data/locale/pt_BR/foreman_webhooks.po +39 -1
  35. data/locale/ru/foreman_webhooks.po +39 -1
  36. data/locale/zh_CN/foreman_webhooks.po +39 -1
  37. data/locale/zh_TW/foreman_webhooks.po +39 -1
  38. metadata +18 -4
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  "は必須です"
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  "ვებჰუკის ნიმუშის შემოტანა"
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  "ვებჰუკები სია"
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  "პაროლი"
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  "პროქსის ავტორიზაცია"
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  "შაბლონის სახელი"
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  "შაბლონი დაბლოკილია."
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  "ვებჰუკი"
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  "ვებჰუკი %s წარმატებით წაიშალა"
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  "ვებჰუკის ნიმუშები"
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  "ვებჰუკი წარმატებით შეიქმნა."
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  "დაიბლოკება თუ არა შაბლონი მისი ჩასწორებისას"
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  "X509 CA"
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  "აპირებთ წაშალოთ %s. დარწმუნებული ბრძანდებით?"
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  "აუცილებელია"
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  ""
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  ""
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  "é necessário"
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  ""
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  "是必需的"
235
274
  ]
@@ -104,6 +104,9 @@
104
104
  "Import a webhook template": [
105
105
  ""
106
106
  ],
107
+ "In case you are using dynamic URL (ERB template), this will not be rendered correctly due to the absence of a real object.": [
108
+ ""
109
+ ],
107
110
  "List Webhooks": [
108
111
  ""
109
112
  ],
@@ -128,6 +131,12 @@
128
131
  "Password": [
129
132
  ""
130
133
  ],
134
+ "Payload": [
135
+ ""
136
+ ],
137
+ "Please, note that this will not contain actual information or render the attached template.": [
138
+ ""
139
+ ],
131
140
  "Proxy Authorization": [
132
141
  ""
133
142
  ],
@@ -161,6 +170,18 @@
161
170
  "Template name": [
162
171
  ""
163
172
  ],
173
+ "Test": [
174
+ ""
175
+ ],
176
+ "Test a Webhook": [
177
+ ""
178
+ ],
179
+ "Test payload will be sent as is. Cant be a JSON object": [
180
+ ""
181
+ ],
182
+ "Test webhook": [
183
+ ""
184
+ ],
164
185
  "This template is locked for editing.": [
165
186
  ""
166
187
  ],
@@ -191,12 +212,21 @@
191
212
  "Webhook": [
192
213
  ""
193
214
  ],
215
+ "Webhook %s test was successful": [
216
+ ""
217
+ ],
194
218
  "Webhook %s was successfully deleted": [
195
219
  ""
196
220
  ],
197
221
  "Webhook Templates": [
198
222
  ""
199
223
  ],
224
+ "Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?": [
225
+ ""
226
+ ],
227
+ "Webhook test failed: %s": [
228
+ ""
229
+ ],
200
230
  "Webhook was successfully created.": [
201
231
  ""
202
232
  ],
@@ -221,6 +251,9 @@
221
251
  "Whether or not the template is locked for editing": [
222
252
  ""
223
253
  ],
254
+ "Will be sent as is": [
255
+ ""
256
+ ],
224
257
  "X509 Certification Authorities": [
225
258
  ""
226
259
  ],
@@ -230,6 +263,12 @@
230
263
  "You are about to delete %s. Are you sure?": [
231
264
  ""
232
265
  ],
266
+ "You are about to test %s webhook.": [
267
+ ""
268
+ ],
269
+ "You can specify below a custom payload to test the webhook with.": [
270
+ ""
271
+ ],
233
272
  "is required": [
234
273
  ""
235
274
  ]
@@ -21,14 +21,17 @@ module ForemanWebhooks
21
21
  end
22
22
 
23
23
  apipie :method, 'Creates final payload' do
24
- required :hash, Hash, 'Key=value object with with data that should be present in payload'
24
+ optional :hash, Hash, 'Key:value object with with data that should be present in payload', default: {}
25
25
  keyword :with_defaults, [true, false], 'If set to true, adds default entries to the payload', default: true
26
+ kwlist :kwargs, 'Additional key:value pairs that should be added to the payload'
26
27
  returns String, 'JSON string with the final payload'
27
28
  example 'payload({ id: @object.id, name: @object.name }) #=> ' \
28
29
  '"{ "id": 1, "name": "host.example.com", "context": { ... }, ' \
29
30
  '"event_name": "host_created.event.foreman" }"'
30
31
  end
31
- def payload(hash, with_defaults: true)
32
+ def payload(hash = {}, with_defaults: true, **kwargs)
33
+ raise ArgumentError, 'The first argument must be either a hash or a comma-separated list with key:value pairs' unless hash.is_a?(Hash)
34
+ hash.merge!(kwargs)
32
35
  hash.merge!(@defaults) if with_defaults
33
36
  hash.to_json
34
37
  end