Class: JLDrill::ShowStatisticsContext::StatisticsView

Inherits:
Context::View
  • Object
show all
Defined in:
lib/jldrill/contexts/ShowStatisticsContext.rb

Direct Known Subclasses

Gtk::StatisticsView, Test::StatisticsView

Instance Attribute Summary collapse

Attributes inherited from Context::View

#context

Instance Method Summary collapse

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

#quizObject (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

#closeObject

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

#destroyObject

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