Class: Copyleaks::NewResultScore
- Inherits:
-
Object
- Object
- Copyleaks::NewResultScore
- Defined in:
- lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb
Instance Attribute Summary collapse
-
#aggregatedScore ⇒ Object
readonly
Returns the value of attribute aggregatedScore.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(aggregatedScore:) ⇒ NewResultScore
constructor
A new instance of NewResultScore.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(aggregatedScore:) ⇒ NewResultScore
Returns a new instance of NewResultScore.
26 27 28 29 30 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb', line 26 def initialize(aggregatedScore:) raise 'Copyleaks::NewResultScore - aggregatedScore must be a Float' unless aggregatedScore.is_a?(Float) || aggregatedScore.is_a?(Integer) @aggregatedScore = aggregatedScore.to_f end |
Instance Attribute Details
#aggregatedScore ⇒ Object (readonly)
Returns the value of attribute aggregatedScore.
23 24 25 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb', line 23 def aggregatedScore @aggregatedScore end |
Instance Method Details
#as_json(*_args) ⇒ Object
32 33 34 35 36 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb', line 32 def as_json(*_args) { aggregatedScore: @aggregatedScore } end |
#to_json(*options) ⇒ Object
38 39 40 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb', line 38 def to_json(*) as_json(*).to_json(*) end |