roqua-rom-api 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/nl.yml +1 -1
- data/lib/roqua/rom_api/list_auto_protocols.rb +16 -0
- data/lib/roqua/rom_api/models/auto_protocol.rb +27 -0
- data/lib/roqua/rom_api/models.rb +1 -0
- data/lib/roqua/rom_api/version.rb +1 -1
- data/lib/roqua/rom_api.rb +1 -0
- data/spec/lib/roqua/rom_api/list_auto_protocols_spec.rb +21 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4cbc3256f5ae1f1cc8925aeddd23a062557f5f31b88d17908e5856d4ff22f5
|
4
|
+
data.tar.gz: e7202043808f8d9993729a94e5adc4369830ad43bb2cb4a720d012d5c647128c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1769591f3affdddcc516c07d965603f4effd9470b9c7e0db6ec05422df5e0dd3d3be0c9383e0ca1e6544c65a3fc9e79a9ffdfaaefbeaff74f72937ef77fbe75
|
7
|
+
data.tar.gz: 139002940dfab95e73caa7678102b7edf32f15df2230c0b306fa309d7adb766c00df6ae634717a18d3647bee7872a983449ec844c71dfac10591e855d7666cba
|
data/config/locales/nl.yml
CHANGED
@@ -11,7 +11,7 @@ nl:
|
|
11
11
|
base:
|
12
12
|
protocol_must_be_automatic: Het protocol is niet geautomatiseerd.
|
13
13
|
protocol_scheduler_options_invalid: Het protocol is verkeerd ingesteld.
|
14
|
-
|
14
|
+
respondent_taken: Dit dossier is reeds geabonneerd op dit protocol.
|
15
15
|
flag_does_not_exist: Een van de opgegeven vlaggen bestaat niet.
|
16
16
|
flag_value_invalid: Een van de opgegeven vlaggen bevat een waarde anders dan true, false of nil.
|
17
17
|
text_message_template_blank: Er is geen SMS-template beschikbaar voor het protocol.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Roqua
|
2
|
+
module RomApi
|
3
|
+
# @api private
|
4
|
+
class ListAutoProtocols < Endpoint
|
5
|
+
def execute
|
6
|
+
validate_response_for do
|
7
|
+
basic_auth_session.get "/auto_protocols"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def response_to_result(response)
|
12
|
+
response.map { |r| Models::AutoProtocol.new(r) }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'virtus'
|
2
|
+
|
3
|
+
module Roqua
|
4
|
+
module RomApi
|
5
|
+
module Models
|
6
|
+
class AutoProtocol
|
7
|
+
include Virtus.model
|
8
|
+
|
9
|
+
# @!attribute [r] id
|
10
|
+
# @return [Integer]
|
11
|
+
attribute :id, Integer
|
12
|
+
# @!attribute key
|
13
|
+
# @return [String]
|
14
|
+
attribute :key, String
|
15
|
+
# @!attribute name
|
16
|
+
# @return [String]
|
17
|
+
attribute :name, String
|
18
|
+
# @!attribute description
|
19
|
+
# @return [String]
|
20
|
+
attribute :description, String
|
21
|
+
# @!attribute active
|
22
|
+
# @return [Boolean]
|
23
|
+
attribute :active, Boolean
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/roqua/rom_api/models.rb
CHANGED
@@ -6,6 +6,7 @@ require 'roqua/rom_api/models/measurement_sequence'
|
|
6
6
|
require 'roqua/rom_api/models/questionnaire'
|
7
7
|
require 'roqua/rom_api/models/measurement'
|
8
8
|
require 'roqua/rom_api/models/protocol'
|
9
|
+
require 'roqua/rom_api/models/auto_protocol'
|
9
10
|
require 'roqua/rom_api/models/dossier_stats'
|
10
11
|
require 'roqua/rom_api/models/stats'
|
11
12
|
require 'roqua/rom_api/models/non_response'
|
data/lib/roqua/rom_api.rb
CHANGED
@@ -16,6 +16,7 @@ require 'roqua/rom_api/stop_protocol_subscription'
|
|
16
16
|
require 'roqua/rom_api/report_calculations'
|
17
17
|
require 'roqua/rom_api/get_questionnaire'
|
18
18
|
require 'roqua/rom_api/list_dossier_stats'
|
19
|
+
require 'roqua/rom_api/list_auto_protocols'
|
19
20
|
require 'roqua/rom_api/list_protocols'
|
20
21
|
require 'roqua/rom_api/get_protocol'
|
21
22
|
require 'roqua/rom_api/get_measurement'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ListAutoProtocols do
|
4
|
+
let(:api_path) { "/auto_protocols" }
|
5
|
+
let(:response) { httparty_response [{
|
6
|
+
'id' => 1,
|
7
|
+
'name' => 'prot'
|
8
|
+
}] }
|
9
|
+
let(:session) { Fabricate :basic_auth_session }
|
10
|
+
before { allow(BasicAuthSession).to receive(:new).and_return session }
|
11
|
+
|
12
|
+
it 'returns an array of protocol objects' do
|
13
|
+
allow(session).to receive(:get).with(api_path).and_return response
|
14
|
+
auto_protocols = ListAutoProtocols.run.result
|
15
|
+
|
16
|
+
expect(auto_protocols).to be_a(Array)
|
17
|
+
expect(auto_protocols.first).to be_a AutoProtocol
|
18
|
+
expect(auto_protocols.first.id).to eq 1
|
19
|
+
expect(auto_protocols.first.name).to eq 'prot'
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-rom-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Esposito
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2024-04-29 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: httparty
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- lib/roqua/rom_api/get_protocol.rb
|
185
185
|
- lib/roqua/rom_api/get_questionnaire.rb
|
186
186
|
- lib/roqua/rom_api/get_respondent.rb
|
187
|
+
- lib/roqua/rom_api/list_auto_protocols.rb
|
187
188
|
- lib/roqua/rom_api/list_dossier_stats.rb
|
188
189
|
- lib/roqua/rom_api/list_non_responses.rb
|
189
190
|
- lib/roqua/rom_api/list_protocol_subscriptions.rb
|
@@ -191,6 +192,7 @@ files:
|
|
191
192
|
- lib/roqua/rom_api/list_respondents.rb
|
192
193
|
- lib/roqua/rom_api/list_responses.rb
|
193
194
|
- lib/roqua/rom_api/models.rb
|
195
|
+
- lib/roqua/rom_api/models/auto_protocol.rb
|
194
196
|
- lib/roqua/rom_api/models/dossier_stats.rb
|
195
197
|
- lib/roqua/rom_api/models/fill_out_request.rb
|
196
198
|
- lib/roqua/rom_api/models/measurement.rb
|
@@ -219,6 +221,7 @@ files:
|
|
219
221
|
- spec/lib/roqua/rom_api/get_non_response_spec.rb
|
220
222
|
- spec/lib/roqua/rom_api/get_protocol_spec.rb
|
221
223
|
- spec/lib/roqua/rom_api/get_respondent_spec.rb
|
224
|
+
- spec/lib/roqua/rom_api/list_auto_protocols_spec.rb
|
222
225
|
- spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
|
223
226
|
- spec/lib/roqua/rom_api/list_non_responses_spec.rb
|
224
227
|
- spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
|
@@ -260,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
263
|
- !ruby/object:Gem::Version
|
261
264
|
version: '0'
|
262
265
|
requirements: []
|
263
|
-
rubygems_version: 3.4.
|
266
|
+
rubygems_version: 3.4.22
|
264
267
|
signing_key:
|
265
268
|
specification_version: 4
|
266
269
|
summary: API wrapper gem around RoQua's ROM API
|
@@ -274,6 +277,7 @@ test_files:
|
|
274
277
|
- spec/lib/roqua/rom_api/get_non_response_spec.rb
|
275
278
|
- spec/lib/roqua/rom_api/get_protocol_spec.rb
|
276
279
|
- spec/lib/roqua/rom_api/get_respondent_spec.rb
|
280
|
+
- spec/lib/roqua/rom_api/list_auto_protocols_spec.rb
|
277
281
|
- spec/lib/roqua/rom_api/list_dossier_stats_spec.rb
|
278
282
|
- spec/lib/roqua/rom_api/list_non_responses_spec.rb
|
279
283
|
- spec/lib/roqua/rom_api/list_protocol_subscriptions_spec.rb
|