Class: Paradeiser::BreaksController

Inherits:
Controller show all
Defined in:
lib/paradeiser/controllers/breaks_controller.rb

Instance Attribute Summary

Attributes inherited from Controller

#exitstatus, #has_output

Instance Method Summary collapse

Methods inherited from Controller

#call, #get_binding, #initialize, #model, #render

Constructor Details

This class inherits a constructor from Paradeiser::Controller

Instance Method Details

#finishObject

Raises:



10
11
12
13
14
15
16
# File 'lib/paradeiser/controllers/breaks_controller.rb', line 10

def finish
  @break = Repository.active
  raise NotActiveError unless @break
  raise SingletonError.new(Break, @break, :finish) if Repository.active? && !@break.kind_of?(Break)
  @break.finish!
  Repository.save(@break)
end

#startObject

Raises:



3
4
5
6
7
8
# File 'lib/paradeiser/controllers/breaks_controller.rb', line 3

def start
  raise SingletonError.new(Break, Repository.active, :start) if Repository.active?

  @break = Break.new
  Repository.save(@break)
end