Class: ScormEngine::Models::Learner

Inherits:
Base
  • Object
show all
Defined in:
lib/scorm_engine/models/learner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#to_hash

Instance Attribute Details

#first_nameObject

TODO: Not sure we want this to be settable. Will depend on how we go about creating/updating records. For now it makes it easier to create instances from API options hash.



7
8
9
# File 'lib/scorm_engine/models/learner.rb', line 7

def first_name
  @first_name
end

#idObject

TODO: Not sure we want this to be settable. Will depend on how we go about creating/updating records. For now it makes it easier to create instances from API options hash.



7
8
9
# File 'lib/scorm_engine/models/learner.rb', line 7

def id
  @id
end

#last_nameObject

TODO: Not sure we want this to be settable. Will depend on how we go about creating/updating records. For now it makes it easier to create instances from API options hash.



7
8
9
# File 'lib/scorm_engine/models/learner.rb', line 7

def last_name
  @last_name
end

Class Method Details

.new_from_api(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/scorm_engine/models/learner.rb', line 9

def self.new_from_api(options = {})
  this = new

  this.options = options.dup
  this.id = options["id"]
  this.first_name = options["firstName"]
  this.last_name = options["lastName"]

  this
end