Class: JLDrill::AppendFileContext

Inherits:
Context::Context show all
Defined in:
lib/jldrill/contexts/AppendFileContext.rb

Instance Attribute Summary

Attributes inherited from Context::Context

#mainView, #parent, #viewBridge

Instance Method Summary collapse

Methods inherited from Context::Context

#addView, #exit, #isEntered?, #onExit, #peekAtView, #setupViews

Constructor Details

#initialize(viewBridge) ⇒ AppendFileContext

Returns a new instance of AppendFileContext.



12
13
14
15
16
# File 'lib/jldrill/contexts/AppendFileContext.rb', line 12

def initialize(viewBridge)
	super(viewBridge)
          @loadQuizContext = LoadQuizContext.new(@viewBridge)
          @mergeQuizContext = MergeQuizContext.new(@viewBridge)
end

Instance Method Details

#createViewsObject



18
19
20
# File 'lib/jldrill/contexts/AppendFileContext.rb', line 18

def createViews
    @mainView =  @viewBridge.VBoxView.new(self)
end

#destroyViewsObject



22
23
24
# File 'lib/jldrill/contexts/AppendFileContext.rb', line 22

def destroyViews
    @mainView = nil
end

#enter(parent, quiz) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/jldrill/contexts/AppendFileContext.rb', line 30

def enter(parent, quiz)
    super(parent)
    newQuiz = Quiz.new
    @loadQuizContext.onExit do
        @mergeQuizContext.onExit do
            exitAppendFileContext
        end
        @mergeQuizContext.enter(self, quiz, newQuiz)
    end
    @loadQuizContext.enter(self, newQuiz)
end

#exitAppendFileContextObject



26
27
28
# File 'lib/jldrill/contexts/AppendFileContext.rb', line 26

def exitAppendFileContext
    self.exit
end