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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d74269c1ef26c6a9f5666cb0b34eb3030d96d4a94068f9461eb19e9f29f1680d
4
- data.tar.gz: 27fd6f294d5fb5253ee040e2b1e096cd4d721561fd749529528d17b46c266bb5
3
+ metadata.gz: 3f9f09bee2cb90376b11857112525d4f8b684fbf413efe376e4a1e62f13165bf
4
+ data.tar.gz: 4ddb77b0f64f4f9da50851e79a106acade6e4f6e20a208702bcc0c241f54202f
5
5
  SHA512:
6
- metadata.gz: 302e041de9c1f187b0cd5948e99291b6a775977bfb436b846a1065034e5b1ab7608867862204a3e3cf36ab786dea0a39e91d0ca6fb5f01acef4afe91c94d13a4
7
- data.tar.gz: 73198c298c04155839cbcbe20a99933633d0c8e6e472c638ab4b2bb2c6d4b130e51256ca9ad691b4c32cb572dc20191253bc23ca6d7cf52f7299b0b33d4623f9
6
+ metadata.gz: d9f07c8575519f7b092ef0c2e035128276a76c6383167446a63559e5d311bc24bb2b2aa9867e7c00b110ec7508194c82aa3ec99c713ac59d1533186118b6db0f
7
+ data.tar.gz: '040280d374b94fe5984c3812ab50e0cf683b925e2a0e146071b0356acdcfa5628b2e10e15f5470b60ad1f05efafa5c7ff00a2cc8fa961acf8ae8c5c9ef8a79c9'
@@ -1,3 +1,4 @@
1
+ require_relative "models/base"
1
2
  require_relative "models/course"
2
3
  require_relative "models/course_configuration"
3
4
  require_relative "models/course_import"
@@ -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 DispatchZip
4
- attr_accessor :options
5
- private :options
6
-
3
+ class DispatchZip < Base
7
4
  attr_accessor :dispatch_id, :type, :filename, :body
8
5
 
9
6
  def initialize(options = {})
@@ -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.
@@ -1,3 +1,3 @@
1
1
  module ScormEngine
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "0.6.1".freeze
3
3
  end
@@ -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.0
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