domoscio_rails 0.4.5 → 0.4.7

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
  SHA256:
3
- metadata.gz: 12f7caee1406f22da61753a940e728fb23ab5b72881be2b9ebb870cad8b378f7
4
- data.tar.gz: 1871d210f8a2626cf8910cdfbae4dcff912f6120ab14a7f52c19b01fb3421b4d
3
+ metadata.gz: 6d0aef7d75b9735ab302a207eb647a844392db480a9928c49fd5e63fc34e6847
4
+ data.tar.gz: '08ef9dd6944fc5ad1cc947915a5dfb681cb3e2099f7a6d95249cf1ce6b6f6ec7'
5
5
  SHA512:
6
- metadata.gz: 917fad865ac84b56dc507399726f74f57fb791acac5f9d376616a69e51bc9af357f5d515180657c349f6f521c8c1b4391c2e353c4e5e6c5fdf1242fdd8e3ad1e
7
- data.tar.gz: 81da6575de8e6798791d27b848de00e51f287650189e49f18fcb543e2f04f91bdb9f2ca884588358194466c6aba302201a2202250d086a9f308834698a3230d8
6
+ metadata.gz: 04d06435aa6c9448a9a5181c052bc49565f3a322ca1b4609120f15f9d8658ce8bd96003faac1f0a1fa63d0c573459c3656f0b381cdaa7a8f675037855b31c28e
7
+ data.tar.gz: 1b16b091b7163e1fd4eba05e8f54b1f22a00471853033d7067f3722476305de6811a01e84f51a203c55f993556f7b7e35a132532bcebcd93a8d3b72f212dcfe0
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
@@ -0,0 +1,8 @@
1
+ module DomoscioRails
2
+ class KnowledgeGraphScale < 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
@@ -0,0 +1,8 @@
1
+ module DomoscioRails
2
+ class Scale < 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
@@ -4,6 +4,5 @@ module DomoscioRails
4
4
  include DomoscioRails::HTTPCalls::Fetch
5
5
  include DomoscioRails::HTTPCalls::Destroy
6
6
  include DomoscioRails::HTTPCalls::Update
7
- include DomoscioRails::HTTPCalls::Util
8
7
  end
9
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,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.5'.freeze
2
+ VERSION = '0.4.7'.freeze
3
3
  end
@@ -14,10 +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'
22
+ require 'domoscio_rails/knowledge/scale'
23
+ require 'domoscio_rails/knowledge/knowledge_graph_scale'
24
+ require 'domoscio_rails/knowledge/knowledge_graph_node'
21
25
  require 'domoscio_rails/knowledge/knowledge_node_content'
22
26
  require 'domoscio_rails/knowledge/knowledge_node_student'
23
27
  require 'domoscio_rails/knowledge/knowledge_node'
@@ -36,7 +40,7 @@ require 'domoscio_rails/utils/gameplay_util'
36
40
  require 'domoscio_rails/utils/recommendation_util'
37
41
  require 'domoscio_rails/utils/review_util'
38
42
  require 'domoscio_rails/utils/stats_util'
39
- require 'domoscio_rails/scorm/scorm'
43
+ require 'domoscio_rails/utils/lxp'
40
44
 
41
45
  module DomoscioRails
42
46
  # Configurable attributes and default values
@@ -75,7 +79,8 @@ module DomoscioRails
75
79
  # Raises DomoscioRails::ResponseError on Adaptive Error Status
76
80
  # Raises DomoscioRails::ProcessingError on Internal Error
77
81
  #
78
- def self.request(method, url, params={})
82
+ def self.request(method, url, params = {})
83
+ params ||= {}
79
84
  store_tokens, headers = request_headers
80
85
  params.merge!({ 'per_page': 1000 }) unless params[:per_page]
81
86
  uri = api_uri(url)
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.5
4
+ version: 0.4.7
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-03-30 00:00:00.000000000 Z
11
+ date: 2022-05-26 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,9 +64,12 @@ 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
68
+ - lib/domoscio_rails/knowledge/knowledge_graph_scale.rb
66
69
  - lib/domoscio_rails/knowledge/knowledge_node.rb
67
70
  - lib/domoscio_rails/knowledge/knowledge_node_content.rb
68
71
  - lib/domoscio_rails/knowledge/knowledge_node_student.rb
72
+ - lib/domoscio_rails/knowledge/scale.rb
69
73
  - lib/domoscio_rails/objective/learning_program.rb
70
74
  - lib/domoscio_rails/objective/learning_program_student.rb
71
75
  - lib/domoscio_rails/objective/objective.rb
@@ -74,12 +78,12 @@ files:
74
78
  - lib/domoscio_rails/objective/objective_student.rb
75
79
  - lib/domoscio_rails/objective/subscription.rb
76
80
  - lib/domoscio_rails/resource.rb
77
- - lib/domoscio_rails/scorm/scorm.rb
78
81
  - lib/domoscio_rails/tag/tag.rb
79
82
  - lib/domoscio_rails/tag/tag_edge.rb
80
83
  - lib/domoscio_rails/tag/tag_set.rb
81
84
  - lib/domoscio_rails/tag/tagging.rb
82
85
  - lib/domoscio_rails/utils/gameplay_util.rb
86
+ - lib/domoscio_rails/utils/lxp.rb
83
87
  - lib/domoscio_rails/utils/recommendation_util.rb
84
88
  - lib/domoscio_rails/utils/review_util.rb
85
89
  - lib/domoscio_rails/utils/stats_util.rb
@@ -88,7 +92,7 @@ homepage: http://www.domoscio.com
88
92
  licenses:
89
93
  - MIT
90
94
  metadata: {}
91
- post_install_message:
95
+ post_install_message:
92
96
  rdoc_options: []
93
97
  require_paths:
94
98
  - lib
@@ -103,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
107
  - !ruby/object:Gem::Version
104
108
  version: '0'
105
109
  requirements: []
106
- rubygems_version: 3.1.4
107
- signing_key:
110
+ rubygems_version: 3.2.22
111
+ signing_key:
108
112
  specification_version: 4
109
113
  summary: Summary of DomoscioRailspec.
110
114
  test_files: []