Class: Balboa::Interactor::Command::FillPunchCommand

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/balboa/interactor/command/fill_punch_command.rb

Constant Summary collapse

TIME_TEMPLATE =
'%02d:00'.freeze
SUCCESS_MESSAGE =
'Punch foi criado com sucesso.'.freeze
PunchCreationError =
Class.new(RuntimeError)

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FillPunchCommand

Returns a new instance of FillPunchCommand.



16
17
18
# File 'lib/balboa/interactor/command/fill_punch_command.rb', line 16

def initialize(options)
  @options = options
end

Instance Method Details

#execute(date) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/balboa/interactor/command/fill_punch_command.rb', line 20

def execute(date)
  visit_new_punch_path

  fill_first_shift(date)

  visit_new_punch_path

  fill_second_shift(date)
end