domoscio_rails 0.4.6 → 0.4.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 154d7d867e08c73e376f69ce18743c51cb67ef9b77670996b4905c41ba386be9
4
- data.tar.gz: cd794f1d6b7745883ce34ebf0107da4a1ca1809bfc845f791108815eacb5c164
3
+ metadata.gz: 8dea61bf2ec4bf182cd358c43bf19e19ca87b3c0d51b83f71e06387b2dcbe1e0
4
+ data.tar.gz: 7fb3a4630734a839b200f0a4511d3868ef7f95769b72f13b02472ce40fce39cd
5
5
  SHA512:
6
- metadata.gz: 07af1245f733e97ff325029682899dd0833406b9b635800ecb542ad76decd07c04c4dd8bdc2af6fa33ba434c4717ce46f1f2644d32204fab2e54a27d5a789f8e
7
- data.tar.gz: 99f01fa87b10843eb354ccb5c336cf1540727be4d4c52ca45c9965457e8cedaacc3b8dbf4fdc8c9577ef12a57a63228559a8eb88408fab024e10af9a4e95a3c0
6
+ metadata.gz: d8fdc5778ed8b817d94fa6b4c69165006e12ed2aae8543d4f55a3c60f9494794f8a336d83261ed0d80e84fb01da2157ad819b3c8fd884e512bde23a644553bc3
7
+ data.tar.gz: f3dc7d00e1e5efaaa0d0bfd62e3a1c3f139a0383a9ce53fe1a01fdaf2ba6218a58b60edb61273579534d6c93d19620251aeadc20eaa110066d12b591b1298675
File without changes
@@ -76,5 +76,22 @@ module DomoscioRails
76
76
  base.extend(ClassMethods)
77
77
  end
78
78
  end
79
+
80
+ # Raw module allow calls not to be scoped by instance
81
+ module Raw
82
+ module ClassMethods
83
+ def raw_util(util_name = nil, params = {})
84
+ DomoscioRails.request(:get, raw_url(util_name), raw_params(params))
85
+ end
86
+
87
+ def raw_util_post(util_name = nil, params = {})
88
+ DomoscioRails.request(:post, raw_url(util_name), raw_params(params))
89
+ end
90
+ end
91
+
92
+ def self.included(base)
93
+ base.extend(ClassMethods)
94
+ end
95
+ end
79
96
  end
80
97
  end
@@ -0,0 +1,8 @@
1
+ module DomoscioRails
2
+ class KnowledgeGraphNode < Resource
3
+ include DomoscioRails::HTTPCalls::Create
4
+ include DomoscioRails::HTTPCalls::Fetch
5
+ include DomoscioRails::HTTPCalls::Destroy
6
+ include DomoscioRails::HTTPCalls::Update
7
+ end
8
+ end
@@ -5,18 +5,33 @@ module DomoscioRails
5
5
  name.split('::')[-1]
6
6
  end
7
7
 
8
- def url(id = nil, util_name = nil, on_self = nil)
8
+ def url(id = nil, util_name = nil)
9
9
  raise NotImplementedError, 'Resource is an abstract class. Do not use it directly.' if self == Resource
10
10
 
11
11
  build_url = "/v#{DomoscioRails.configuration.version}/instances/#{DomoscioRails.configuration.client_id}"
12
- unless on_self
13
- build_url << "/#{underscore(class_name)}s"
14
- build_url << "/#{util_name}" if util_name
15
- build_url << "/#{CGI.escape(id.to_s)}" if id
16
- end
12
+ build_url << "/#{underscore(class_name)}s"
13
+ build_url << "/#{util_name}" if util_name
14
+ build_url << "/#{CGI.escape(id.to_s)}" if id
15
+
17
16
  build_url
18
17
  end
19
18
 
19
+ def raw_url(util_name)
20
+ raise NotImplementedError, 'Resource is an abstract class. Do not use it directly.' if self == Resource
21
+
22
+ build_url = "/v#{DomoscioRails.configuration.version}"
23
+ build_url << "/#{underscore(class_name)}s"
24
+ build_url << "/#{util_name}" if util_name
25
+
26
+ build_url
27
+ end
28
+
29
+ def raw_params(params = {})
30
+ params.merge({
31
+ instance_id: DomoscioRails.configuration.client_id
32
+ })
33
+ end
34
+
20
35
  def underscore(string)
21
36
  string.gsub(/::/, '/')
22
37
  .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
@@ -0,0 +1,5 @@
1
+ module DomoscioRails
2
+ class Analytic < Resource
3
+ include DomoscioRails::HTTPCalls::Util
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module DomoscioRails
2
+ class Lxp < Resource
3
+ include DomoscioRails::HTTPCalls::Raw
4
+ include DomoscioRails::HTTPCalls::Util
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module DomoscioRails
2
- VERSION = '0.4.6'.freeze
2
+ VERSION = '0.4.8'.freeze
3
3
  end
@@ -14,12 +14,14 @@ require 'domoscio_rails/data/event'
14
14
  require 'domoscio_rails/data/instance'
15
15
  require 'domoscio_rails/data/recommendation'
16
16
  require 'domoscio_rails/data/learning_session'
17
+ require 'domoscio_rails/data/scorm'
17
18
  require 'domoscio_rails/data/student'
18
19
  require 'domoscio_rails/data/student_group'
19
20
  require 'domoscio_rails/knowledge/knowledge_edge'
20
21
  require 'domoscio_rails/knowledge/knowledge_graph'
21
22
  require 'domoscio_rails/knowledge/scale'
22
23
  require 'domoscio_rails/knowledge/knowledge_graph_scale'
24
+ require 'domoscio_rails/knowledge/knowledge_graph_node'
23
25
  require 'domoscio_rails/knowledge/knowledge_node_content'
24
26
  require 'domoscio_rails/knowledge/knowledge_node_student'
25
27
  require 'domoscio_rails/knowledge/knowledge_node'
@@ -34,11 +36,12 @@ require 'domoscio_rails/tag/tag_edge'
34
36
  require 'domoscio_rails/tag/tag_set'
35
37
  require 'domoscio_rails/tag/tag'
36
38
  require 'domoscio_rails/tag/tagging'
39
+ require 'domoscio_rails/utils/analytic'
37
40
  require 'domoscio_rails/utils/gameplay_util'
38
41
  require 'domoscio_rails/utils/recommendation_util'
39
42
  require 'domoscio_rails/utils/review_util'
40
43
  require 'domoscio_rails/utils/stats_util'
41
- require 'domoscio_rails/scorm/scorm'
44
+ require 'domoscio_rails/utils/lxp'
42
45
 
43
46
  module DomoscioRails
44
47
  # Configurable attributes and default values
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domoscio_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoit Praly
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-16 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -56,6 +56,7 @@ files:
56
56
  - lib/domoscio_rails/data/instance.rb
57
57
  - lib/domoscio_rails/data/learning_session.rb
58
58
  - lib/domoscio_rails/data/recommendation.rb
59
+ - lib/domoscio_rails/data/scorm.rb
59
60
  - lib/domoscio_rails/data/student.rb
60
61
  - lib/domoscio_rails/data/student_group.rb
61
62
  - lib/domoscio_rails/errors.rb
@@ -63,6 +64,7 @@ files:
63
64
  - lib/domoscio_rails/json.rb
64
65
  - lib/domoscio_rails/knowledge/knowledge_edge.rb
65
66
  - lib/domoscio_rails/knowledge/knowledge_graph.rb
67
+ - lib/domoscio_rails/knowledge/knowledge_graph_node.rb
66
68
  - lib/domoscio_rails/knowledge/knowledge_graph_scale.rb
67
69
  - lib/domoscio_rails/knowledge/knowledge_node.rb
68
70
  - lib/domoscio_rails/knowledge/knowledge_node_content.rb
@@ -76,12 +78,13 @@ files:
76
78
  - lib/domoscio_rails/objective/objective_student.rb
77
79
  - lib/domoscio_rails/objective/subscription.rb
78
80
  - lib/domoscio_rails/resource.rb
79
- - lib/domoscio_rails/scorm/scorm.rb
80
81
  - lib/domoscio_rails/tag/tag.rb
81
82
  - lib/domoscio_rails/tag/tag_edge.rb
82
83
  - lib/domoscio_rails/tag/tag_set.rb
83
84
  - lib/domoscio_rails/tag/tagging.rb
85
+ - lib/domoscio_rails/utils/analytic.rb
84
86
  - lib/domoscio_rails/utils/gameplay_util.rb
87
+ - lib/domoscio_rails/utils/lxp.rb
85
88
  - lib/domoscio_rails/utils/recommendation_util.rb
86
89
  - lib/domoscio_rails/utils/review_util.rb
87
90
  - lib/domoscio_rails/utils/stats_util.rb
@@ -90,7 +93,7 @@ homepage: http://www.domoscio.com
90
93
  licenses:
91
94
  - MIT
92
95
  metadata: {}
93
- post_install_message:
96
+ post_install_message:
94
97
  rdoc_options: []
95
98
  require_paths:
96
99
  - lib
@@ -106,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
109
  version: '0'
107
110
  requirements: []
108
111
  rubygems_version: 3.2.22
109
- signing_key:
112
+ signing_key:
110
113
  specification_version: 4
111
114
  summary: Summary of DomoscioRailspec.
112
115
  test_files: []