Class: Fet::ScoreSummary

Inherits:
Object
  • Object
show all
Extended by:
ScoreSummaryWriter
Defined in:
lib/fet/score_summary.rb

Overview

Responsible for writing + showing the score summary to the user

Constant Summary collapse

NO_SCORES_MESSAGE =
"No scores available yet!".deep_freeze

Constants included from ScoreSummaryWriter

Fet::ScoreSummaryWriter::SCORES_FILENAME

Instance Method Summary collapse

Methods included from ScoreSummaryWriter

add_entry, scores_filename

Constructor Details

#initialize(minimum_session_length: 0, number_of_degrees: nil, key_type: nil, begin_offset: 0, end_offset: 0) ⇒ ScoreSummary

Returns a new instance of ScoreSummary.



15
16
17
18
19
20
21
# File 'lib/fet/score_summary.rb', line 15

def initialize(minimum_session_length: 0, number_of_degrees: nil, key_type: nil, begin_offset: 0, end_offset: 0)
  self.minimum_session_length = minimum_session_length
  self.number_of_degrees = number_of_degrees
  self.key_type = key_type
  self.begin_offset = begin_offset
  self.end_offset = end_offset
end

Instance Method Details

#summaryObject



23
24
25
26
27
28
29
# File 'lib/fet/score_summary.rb', line 23

def summary
  if file_exists?
    percentage_summary
  else
    puts NO_SCORES_MESSAGE
  end
end