Class: PupilfirstXapi::Statements::CourseRegistered
- Inherits:
-
Object
- Object
- PupilfirstXapi::Statements::CourseRegistered
- Defined in:
- lib/pupilfirst_xapi/statements/course_registered.rb
Instance Method Summary collapse
- #call(actor_id:, resource_id:) ⇒ Object
-
#initialize(repository, uri_for) ⇒ CourseRegistered
constructor
A new instance of CourseRegistered.
Constructor Details
#initialize(repository, uri_for) ⇒ CourseRegistered
Returns a new instance of CourseRegistered.
4 5 6 7 |
# File 'lib/pupilfirst_xapi/statements/course_registered.rb', line 4 def initialize(repository, uri_for) @repository = repository @uri_for = uri_for end |
Instance Method Details
#call(actor_id:, resource_id:) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pupilfirst_xapi/statements/course_registered.rb', line 9 def call(actor_id:, resource_id:) actor = @repository.call(:user, actor_id) course = @repository.call(:course, resource_id) Xapi.create_statement( actor: Actors.agent(actor), verb: Verbs::REGISTERED, object: Objects.course(course, @uri_for) ) end |