Class: GitPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/git_presenter.rb

Defined Under Namespace

Classes: Controller, Presentation, Shell, Slide

Instance Method Summary collapse

Constructor Details

#initialize(current_dir, interactive = true) ⇒ GitPresenter

Returns a new instance of GitPresenter.



12
13
14
15
# File 'lib/git_presenter.rb', line 12

def initialize(current_dir, interactive=true)
  @controller = Controller.new(current_dir)
  @interactive = interactive
end

Instance Method Details

#current_slideObject



36
37
38
# File 'lib/git_presenter.rb', line 36

def current_slide
  @presentation.current_slide
end

#execute(command) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/git_presenter.rb', line 17

def execute(command)
  if command == 'init'
    @controller.initialise_presentation
  elsif command == 'start'
    @presentation = @controller.start_presentation
    if @interactive
      enter_run_loop
    end
  elsif command == 'update'
    @controller.update_presentation
  else
    if @presentation.nil?
      @presentation = @controller.load_presentation
    end
    puts @presentation.execute(command)
  end
  @presentation
end