Class: Copyleaks::ScoreWeights
- Inherits:
-
Object
- Object
- Copyleaks::ScoreWeights
- Defined in:
- lib/copyleaks/models/submissions/writing_assistant/score_weights.rb
Instance Attribute Summary collapse
- #grammar_score_weight ⇒ Object
- #mechanics_score_weight ⇒ Object
- #sentence_structure_score_weight ⇒ Object
- #word_choice_score_weight ⇒ Object
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(grammar_score_weight, mechanics_score_weight, sentence_structure_score_weight, word_choice_score_weight) ⇒ ScoreWeights
constructor
A new instance of ScoreWeights.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(grammar_score_weight, mechanics_score_weight, sentence_structure_score_weight, word_choice_score_weight) ⇒ ScoreWeights
Returns a new instance of ScoreWeights.
34 35 36 37 38 39 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 34 def initialize(grammar_score_weight, mechanics_score_weight, sentence_structure_score_weight, word_choice_score_weight) @grammar_score_weight = grammar_score_weight @mechanics_score_weight = mechanics_score_weight @sentence_structure_score_weight = sentence_structure_score_weight @word_choice_score_weight = word_choice_score_weight end |
Instance Attribute Details
#grammar_score_weight ⇒ Object
32 33 34 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 32 def grammar_score_weight @grammar_score_weight end |
#mechanics_score_weight ⇒ Object
32 33 34 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 32 def mechanics_score_weight @mechanics_score_weight end |
#sentence_structure_score_weight ⇒ Object
32 33 34 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 32 def sentence_structure_score_weight @sentence_structure_score_weight end |
#word_choice_score_weight ⇒ Object
32 33 34 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 32 def word_choice_score_weight @word_choice_score_weight end |
Instance Method Details
#as_json(*_args) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 41 def as_json(*_args) { grammarScoreWeight: @grammar_score_weight, mechanicsScoreWeight: @mechanics_score_weight, sentenceStructureScoreWeight: @sentence_structure_score_weight, wordChoiceScoreWeight: @word_choice_score_weight }.reject { |_k, v| v.nil? } end |
#to_json(*options) ⇒ Object
50 51 52 |
# File 'lib/copyleaks/models/submissions/writing_assistant/score_weights.rb', line 50 def to_json(*) as_json(*).to_json(*) end |