Class: Rafflesia::Grade

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/episodes/grade.rb

Constant Summary collapse

HASH_ATTRS =
{
  blocking_errors: :blocking_errors,
  grader_hash: :grader_hash,
  metrics: :metrics,
  pass_score: :pass_score,
  passed: :passed,
  reward: :reward,
  reward_definition_id: :reward_definition_id,
  subscores: :subscores,
  warnings: :warnings,
  weights: :weights
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Grade

Returns a new instance of Grade.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rafflesia/episodes/grade.rb', line 33

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @blocking_errors = (hash[:blocking_errors] || [])
  @grader_hash = hash[:grader_hash]
  @metrics = hash[:metrics] || {}
  @pass_score = hash[:pass_score]
  @passed = hash[:passed]
  @reward = hash[:reward]
  @reward_definition_id = hash[:reward_definition_id]
  @subscores = hash[:subscores] || {}
  @warnings = (hash[:warnings] || [])
  @weights = hash[:weights] || {}
end

Instance Attribute Details

#blocking_errorsObject

Returns the value of attribute blocking_errors.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def blocking_errors
  @blocking_errors
end

#grader_hashObject

Returns the value of attribute grader_hash.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def grader_hash
  @grader_hash
end

#metricsObject

Returns the value of attribute metrics.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def metrics
  @metrics
end

#pass_scoreObject

Returns the value of attribute pass_score.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def pass_score
  @pass_score
end

#passedObject

Returns the value of attribute passed.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def passed
  @passed
end

#rewardObject

Returns the value of attribute reward.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def reward
  @reward
end

#reward_definition_idObject

Returns the value of attribute reward_definition_id.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def reward_definition_id
  @reward_definition_id
end

#subscoresObject

Returns the value of attribute subscores.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def subscores
  @subscores
end

#warningsObject

Returns the value of attribute warnings.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def warnings
  @warnings
end

#weightsObject

Returns the value of attribute weights.



21
22
23
# File 'lib/rafflesia/episodes/grade.rb', line 21

def weights
  @weights
end