Class: LogworkManager::CommandHandler
- Inherits:
-
Object
- Object
- LogworkManager::CommandHandler
- Defined in:
- lib/logwork_manager/command_handler.rb
Overview
Manages the Worklog table.
Instance Method Summary collapse
-
#initialize(workday_hours = nil) ⇒ CommandHandler
constructor
Construct.
-
#update_worklog(command, issues = nil, issue_to_add: nil) ⇒ Array<WorklogIssue>
Updates the daily worklog table by applying the given command.
Constructor Details
#initialize(workday_hours = nil) ⇒ CommandHandler
Construct
28 29 30 |
# File 'lib/logwork_manager/command_handler.rb', line 28 def initialize(workday_hours = nil) @workday_hours = workday_hours end |
Instance Method Details
#update_worklog(command, issues = nil, issue_to_add: nil) ⇒ Array<WorklogIssue>
Updates the daily worklog table by applying the given command.
46 47 48 49 50 51 |
# File 'lib/logwork_manager/command_handler.rb', line 46 def update_worklog(command, issues = nil, issue_to_add: nil) command_found = get_command(command.strip) raise LogworkException::InvalidCommand, "Wrong command" if command.nil? || command.empty? || command_found.nil? command_found.update_issues(issues, issue_to_add) end |