Class: Tempo::Controllers::Checkout

Inherits:
Base
  • Object
show all
Defined in:
lib/tempo/controllers/checkout_controller.rb

Class Method Summary collapse

Methods inherited from Base

filter_projects_by_title, fuzzy_match, reassemble_the

Class Method Details

.add_project(options, args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tempo/controllers/checkout_controller.rb', line 8

def add_project(options, args)
  request = reassemble_the args, options[:add]

  if @projects.include? request
    Views::already_exists_error "project", request

  else
    project = @projects.new({ title: request, current: true })
    @projects.save_to_file options
    Views::project_checkout project
  end
end

.assistanceObject



36
37
38
# File 'lib/tempo/controllers/checkout_controller.rb', line 36

def assistance
  Views::checkout_assistance
end

.existing_project(options, args) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/tempo/controllers/checkout_controller.rb', line 21

def existing_project(options, args)

  match = match_project :checkout, options, args

  if match
    if @projects.current == match
      Views::project_already_current match
    else
      @projects.current = match
      @projects.save_to_file options
      Views::project_checkout match
    end
  end
end