Class: LogworkManager::Duration

Inherits:
Command
  • Object
show all
Defined in:
lib/logwork_manager/command.rb

Overview

Command for duration action

Instance Method Summary collapse

Constructor Details

#initialize(arguments, workday_hours) ⇒ Duration

Returns a new instance of Duration.



109
110
111
112
113
114
115
# File 'lib/logwork_manager/command.rb', line 109

def initialize(arguments, workday_hours)
  super
  raise "Wrong numberof arguments #{@args}" if @args.size != 2

  @pos = Integer(@args[0])
  @duration = @args[1]
end

Instance Method Details

#update_issues(issues, _) ⇒ Object



117
118
119
120
121
# File 'lib/logwork_manager/command.rb', line 117

def update_issues(issues, _)
  check_out_of_bounds(issues, @pos)
  issues[@pos].duration = @duration
  issues
end