isaca 0.1.7 → 0.1.8

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: 673f78f81502f22ce8a21209d12a7962c60949e9
4
- data.tar.gz: 696908574a010e26180f4f85530ed99820ccfb5b
3
+ metadata.gz: 638241b987371e717f92ad0adb69ff705c72a892
4
+ data.tar.gz: 40dbbce5548aec9662c16ea8e1bfab7336e7e71e
5
5
  SHA512:
6
- metadata.gz: 26288e7fa7ea9811390a27e19d2f2e932cebc1d809b6d04613838d9b6d0a224e17fc97e58f5e49a865b59add6b58d52f36640f3cbefac0c6b961343b4108ecf3
7
- data.tar.gz: 206e1394350fd730dacc42e493510d2bf76412e5d94017062f3261ffe05e3086cc3539be655bc75ff88252b713f0800b7437f9cae84c95768848fe32b3c5c1ec
6
+ metadata.gz: 4c961ebfdda729d5ac2e7fb22dc96af96cdbc25cef3845f3b6273694abe971572d6b1626730cf8ca48c708df860f7915850ff6f04b9b9b8d21109700c6f0a98c
7
+ data.tar.gz: 221d21e5513a68ae70b4d802fd21f4ddb7c5b283daf2e04e4d01c8f0dc807681726dffe3482e833150fd04a7fb67db44f42f6ea1dcc8f0df09f9b6b4d0d737b6
@@ -0,0 +1,11 @@
1
+ module ISACA
2
+ module Model
3
+ class Countries
4
+ include ISACA::Model::Geographical
5
+
6
+ def initialize(countries)
7
+ @countries = countries
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module ISACA
2
+ module Model
3
+ class ExplicitCountries
4
+ include ISACA::Model::Geographical
5
+
6
+ def initialize(countries)
7
+ @countries = countries
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ module ISACA
2
+ module Model
3
+ module Geographical
4
+ attr_accessor :countries
5
+
6
+ def includes_country?(value)
7
+ value.downcase!
8
+
9
+ countries.each do |country|
10
+ return true if country['CODE'].downcase == value || country['DESCRIPTION'].downcase == value
11
+ end
12
+
13
+ false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module ISACA
2
+ module Request
3
+ module Countries
4
+ def self.get
5
+ response = ISACA::Request.get do |request|
6
+ uri = URI(ISACA.configuration.url)
7
+ request.path = "#{uri.scheme}://#{uri.hostname}:#{uri.port}/isacaservices/countries.json"
8
+ end
9
+
10
+ data = JSON.parse(response.body)
11
+ ISACA.logger.debug(data) if ISACA.configuration.debug
12
+
13
+ response.status == 200 ? ISACA::Model::Countries.new(data) : nil
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ module ISACA
2
+ module Request
3
+ module ExplicitCountries
4
+ def self.get
5
+ response = ISACA::Request.get do |request|
6
+ uri = URI(ISACA.configuration.url)
7
+ request.path = "#{uri.scheme}://#{uri.hostname}:#{uri.port}/isacaservices/explicitcountries.json"
8
+ end
9
+
10
+ data = JSON.parse(response.body)
11
+ ISACA.logger.debug(data) if ISACA.configuration.debug
12
+
13
+ response.status == 200 ? ISACA::Model::ExplicitCountries.new(data) : nil
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ module ISACA
2
+ module Request
3
+ module ReportConsent
4
+ def self.get(imis_id, options={})
5
+ opts = {
6
+ marketing: 0
7
+ }.merge(options)
8
+
9
+ response = ISACA::Request.get do |request|
10
+ request.path = request.path + '/ReportConsent'
11
+ request.params['MarketingConsent'] = opts[:marketing]
12
+ request.params['iMISID'] = imis_id
13
+ end
14
+
15
+ ISACA.logger.debug(response) if ISACA.configuration.debug
16
+
17
+ response.status == 200
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/isaca/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ISACA
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/isaca.rb CHANGED
@@ -1,17 +1,28 @@
1
1
  require 'isaca/helpers'
2
2
 
3
+ # Requests
3
4
  require 'isaca/requests/request'
4
5
  require 'isaca/requests/authenticate_user'
6
+ require 'isaca/requests/countries'
7
+ require 'isaca/requests/explicit_countries'
5
8
  require 'isaca/requests/get_user_by_id'
6
9
  require 'isaca/requests/get_user_details_by_token'
10
+ require 'isaca/requests/report_consent'
7
11
  require 'isaca/requests/submit_cpe'
8
12
  require 'isaca/requests/log_out'
9
13
 
14
+ # Concerns
15
+ require 'isaca/models/geographical'
16
+
17
+ # Models
10
18
  require 'isaca/models/authenticate_user'
19
+ require 'isaca/models/countries'
20
+ require 'isaca/models/explicit_countries'
11
21
  require 'isaca/models/get_user_by_id'
12
22
  require 'isaca/models/get_user_details_by_token'
13
23
  require 'isaca/models/submit_cpe'
14
24
 
25
+ # Everything else where order load order does not matter
15
26
  require 'isaca/version'
16
27
  require 'fileutils'
17
28
  require 'openssl'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isaca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Orahood
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-02 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -85,13 +85,19 @@ files:
85
85
  - lib/isaca.rb
86
86
  - lib/isaca/helpers.rb
87
87
  - lib/isaca/models/authenticate_user.rb
88
+ - lib/isaca/models/countries.rb
89
+ - lib/isaca/models/explicit_countries.rb
90
+ - lib/isaca/models/geographical.rb
88
91
  - lib/isaca/models/get_user_by_id.rb
89
92
  - lib/isaca/models/get_user_details_by_token.rb
90
93
  - lib/isaca/models/submit_cpe.rb
91
94
  - lib/isaca/requests/authenticate_user.rb
95
+ - lib/isaca/requests/countries.rb
96
+ - lib/isaca/requests/explicit_countries.rb
92
97
  - lib/isaca/requests/get_user_by_id.rb
93
98
  - lib/isaca/requests/get_user_details_by_token.rb
94
99
  - lib/isaca/requests/log_out.rb
100
+ - lib/isaca/requests/report_consent.rb
95
101
  - lib/isaca/requests/request.rb
96
102
  - lib/isaca/requests/submit_cpe.rb
97
103
  - lib/isaca/version.rb