Class: JLDrill::ShowStatisticsContext::StatisticsView
- Inherits:
-
Context::View
- Object
- Context::View
- JLDrill::ShowStatisticsContext::StatisticsView
- Defined in:
- lib/jldrill/contexts/ShowStatisticsContext.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#quiz ⇒ Object
readonly
Returns the value of attribute quiz.
Attributes inherited from Context::View
Instance Method Summary collapse
-
#close ⇒ Object
This closes the window.
-
#destroy ⇒ Object
Destroy the window containing the view.
-
#initialize(context) ⇒ StatisticsView
constructor
A new instance of StatisticsView.
-
#showBusy(bool) ⇒ Object
Show the busy cursor in the UI if bool is true.
-
#update(quiz) ⇒ Object
Update the view with the statistics from the quiz.
Methods inherited from Context::View
#addView, #getWidget, #removeView, #removingViewFrom, #viewAddedTo
Constructor Details
#initialize(context) ⇒ StatisticsView
Returns a new instance of StatisticsView.
17 18 19 20 |
# File 'lib/jldrill/contexts/ShowStatisticsContext.rb', line 17 def initialize(context) super(context) @quiz = nil end |
Instance Attribute Details
#quiz ⇒ Object (readonly)
Returns the value of attribute quiz.
15 16 17 |
# File 'lib/jldrill/contexts/ShowStatisticsContext.rb', line 15 def quiz @quiz end |
Instance Method Details
#close ⇒ Object
This closes the window. It’s a convenience function for the test code so that it has something to catch other than the context closing.
25 26 27 |
# File 'lib/jldrill/contexts/ShowStatisticsContext.rb', line 25 def close @context.exit end |
#destroy ⇒ Object
Destroy the window containing the view
30 31 32 |
# File 'lib/jldrill/contexts/ShowStatisticsContext.rb', line 30 def destroy # Please define in the concrete class end |
#showBusy(bool) ⇒ Object
Show the busy cursor in the UI if bool is true. This happens during a long event where the user can’t interact with the window
37 38 39 |
# File 'lib/jldrill/contexts/ShowStatisticsContext.rb', line 37 def showBusy(bool) # Please define in the concrete class end |
#update(quiz) ⇒ Object
Update the view with the statistics from the quiz
42 43 44 45 46 |
# File 'lib/jldrill/contexts/ShowStatisticsContext.rb', line 42 def update(quiz) @quiz = quiz # Please define the rest of this method in the concrete class. # You should call super(quiz) first. end |