Class: Balboa::Interactor::Command::FillPunchCommand
- Inherits:
-
Object
- Object
- Balboa::Interactor::Command::FillPunchCommand
- 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
- #execute(date) ⇒ Object
-
#initialize(schedule, project) ⇒ FillPunchCommand
constructor
A new instance of FillPunchCommand.
Constructor Details
#initialize(schedule, project) ⇒ FillPunchCommand
Returns a new instance of FillPunchCommand.
16 17 18 19 |
# File 'lib/balboa/interactor/command/fill_punch_command.rb', line 16 def initialize(schedule, project) @schedule = schedule @project = project end |
Instance Method Details
#execute(date) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/balboa/interactor/command/fill_punch_command.rb', line 21 def execute(date) visit_new_punch_path fill_first_shift(date) visit_new_punch_path fill_second_shift(date) end |