Class: Balboa::CLI::Command::PunchCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/balboa/cli/command/punch_command.rb

Defined Under Namespace

Classes: PunchDate

Instance Method Summary collapse

Constructor Details

#initialize(interactor) ⇒ PunchCommand

Returns a new instance of PunchCommand.



10
11
12
# File 'lib/balboa/cli/command/punch_command.rb', line 10

def initialize(interactor)
  @interactor = interactor
end

Instance Method Details

#executeObject



14
15
16
17
18
19
20
# File 'lib/balboa/cli/command/punch_command.rb', line 14

def execute
  punch_dates.each do |date|
    $stdout.print("\n#{date.strftime("%d/%m/%Y")}")

    @interactor.punch(date) unless skip_date?(date)
  end
end