Class: Daigaku::Views::TaskView

Inherits:
Object
  • Object
show all
Includes:
Daigaku::Views, Wisper::Publisher
Defined in:
lib/daigaku/views/task_view.rb

Instance Method Summary collapse

Constructor Details

#initializeTaskView

Returns a new instance of TaskView.



10
11
12
13
# File 'lib/daigaku/views/task_view.rb', line 10

def initialize
  @lines = []
  @top = nil
end

Instance Method Details

#enter_task_view(course, chapter, unit) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/daigaku/views/task_view.rb', line 15

def enter_task_view(course, chapter, unit)
  @course = course
  @chapter = chapter
  @unit = unit

  @test_result_lines = nil
  @lines = @unit.task.markdown.lines
  @top_bar_height = 4
  @head_height = 2

  initialize_window(@lines.count + @top_bar_height + @head_height)
end