scorm_engine 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scorm_engine/models.rb +1 -0
- data/lib/scorm_engine/models/base.rb +21 -0
- data/lib/scorm_engine/models/course.rb +1 -4
- data/lib/scorm_engine/models/course_configuration.rb +1 -4
- data/lib/scorm_engine/models/course_import.rb +1 -4
- data/lib/scorm_engine/models/destination.rb +1 -4
- data/lib/scorm_engine/models/dispatch.rb +1 -4
- data/lib/scorm_engine/models/dispatch_zip.rb +1 -4
- data/lib/scorm_engine/models/learner.rb +1 -4
- data/lib/scorm_engine/models/registration.rb +1 -4
- data/lib/scorm_engine/models/registration_activity_detail.rb +1 -4
- data/lib/scorm_engine/models/registration_configuration.rb +1 -4
- data/lib/scorm_engine/models/registration_launch_history.rb +1 -4
- data/lib/scorm_engine/models/registration_runtime_interaction.rb +1 -4
- data/lib/scorm_engine/version.rb +1 -1
- data/spec/scorm_engine/models/base_spec.rb +19 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f9f09bee2cb90376b11857112525d4f8b684fbf413efe376e4a1e62f13165bf
|
4
|
+
data.tar.gz: 4ddb77b0f64f4f9da50851e79a106acade6e4f6e20a208702bcc0c241f54202f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9f07c8575519f7b092ef0c2e035128276a76c6383167446a63559e5d311bc24bb2b2aa9867e7c00b110ec7508194c82aa3ec99c713ac59d1533186118b6db0f
|
7
|
+
data.tar.gz: '040280d374b94fe5984c3812ab50e0cf683b925e2a0e146071b0356acdcfa5628b2e10e15f5470b60ad1f05efafa5c7ff00a2cc8fa961acf8ae8c5c9ef8a79c9'
|
data/lib/scorm_engine/models.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
module ScormEngine
|
2
|
+
module Models
|
3
|
+
class Base
|
4
|
+
attr_accessor :options
|
5
|
+
private :options
|
6
|
+
|
7
|
+
#
|
8
|
+
# Return a hashified representation of the object.
|
9
|
+
#
|
10
|
+
# This hash should not be used to access individual data elements
|
11
|
+
# unavailable via standard accessors, but only for use in marshaling
|
12
|
+
# of the data.
|
13
|
+
#
|
14
|
+
# @return [Hash]
|
15
|
+
#
|
16
|
+
def to_hash
|
17
|
+
options
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -2,10 +2,7 @@ require "time"
|
|
2
2
|
|
3
3
|
module ScormEngine
|
4
4
|
module Models
|
5
|
-
class Course
|
6
|
-
attr_accessor :options
|
7
|
-
private :options
|
8
|
-
|
5
|
+
class Course < Base
|
9
6
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
10
7
|
# about creating/updating records. For now it makes it easier to create
|
11
8
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class CourseConfiguration
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class CourseConfiguration < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class CourseImport
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class CourseImport < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class Destination
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class Destination < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
@@ -2,10 +2,7 @@ require "date"
|
|
2
2
|
|
3
3
|
module ScormEngine
|
4
4
|
module Models
|
5
|
-
class Dispatch
|
6
|
-
attr_accessor :options
|
7
|
-
private :options
|
8
|
-
|
5
|
+
class Dispatch < Base
|
9
6
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
10
7
|
# about creating/updating records. For now it makes it easier to create
|
11
8
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class Learner
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class Learner < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
@@ -9,10 +9,7 @@
|
|
9
9
|
#
|
10
10
|
module ScormEngine
|
11
11
|
module Models
|
12
|
-
class Registration
|
13
|
-
attr_accessor :options
|
14
|
-
private :options
|
15
|
-
|
12
|
+
class Registration < Base
|
16
13
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
17
14
|
# about creating/updating records. For now it makes it easier to create
|
18
15
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class RegistrationActivityDetail
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class RegistrationActivityDetail < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class RegistrationConfiguration
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class RegistrationConfiguration < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
@@ -5,10 +5,7 @@
|
|
5
5
|
#
|
6
6
|
module ScormEngine
|
7
7
|
module Models
|
8
|
-
class RegistrationLaunchHistory
|
9
|
-
attr_accessor :options
|
10
|
-
private :options
|
11
|
-
|
8
|
+
class RegistrationLaunchHistory < Base
|
12
9
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
13
10
|
# about creating/updating records. For now it makes it easier to create
|
14
11
|
# instances from API options hash.
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module ScormEngine
|
2
2
|
module Models
|
3
|
-
class RegistrationRuntimeInteraction
|
4
|
-
attr_accessor :options
|
5
|
-
private :options
|
6
|
-
|
3
|
+
class RegistrationRuntimeInteraction < Base
|
7
4
|
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
5
|
# about creating/updating records. For now it makes it easier to create
|
9
6
|
# instances from API options hash.
|
data/lib/scorm_engine/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
RSpec.describe ScormEngine::Models::Base do
|
2
|
+
module ScormEngine
|
3
|
+
module Models
|
4
|
+
class Test < Base
|
5
|
+
def initialize(options = {})
|
6
|
+
@options = options
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "#to_hash" do
|
13
|
+
it "returns a hash of the options" do
|
14
|
+
options = { i: 1, s: "str", a: [1, 2, 3] }
|
15
|
+
test = ScormEngine::Models::Test.new(options)
|
16
|
+
expect(test.to_hash).to eq options
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scorm_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Hallstrom
|
@@ -190,6 +190,7 @@ files:
|
|
190
190
|
- lib/scorm_engine/faraday/connection.rb
|
191
191
|
- lib/scorm_engine/faraday/request.rb
|
192
192
|
- lib/scorm_engine/models.rb
|
193
|
+
- lib/scorm_engine/models/base.rb
|
193
194
|
- lib/scorm_engine/models/course.rb
|
194
195
|
- lib/scorm_engine/models/course_configuration.rb
|
195
196
|
- lib/scorm_engine/models/course_import.rb
|
@@ -361,6 +362,7 @@ files:
|
|
361
362
|
- spec/scorm_engine/api/endpoints/registrations_spec.rb
|
362
363
|
- spec/scorm_engine/configuration_spec.rb
|
363
364
|
- spec/scorm_engine/faraday/connection_spec.rb
|
365
|
+
- spec/scorm_engine/models/base_spec.rb
|
364
366
|
- spec/scorm_engine/models/course_configuration_spec.rb
|
365
367
|
- spec/scorm_engine/models/course_import_spec.rb
|
366
368
|
- spec/scorm_engine/models/course_spec.rb
|