Class: Tlog::Command::Owner

Inherits:
Tlog::Command show all
Defined in:
lib/tlog/command/owner.rb

Instance Attribute Summary

Attributes inherited from Tlog::Command

#date_time_format, #seconds_format, #storage

Instance Method Summary collapse

Instance Method Details

#descriptionObject



8
9
10
# File 'lib/tlog/command/owner.rb', line 8

def description
  "changes the owner of the checked-out time log"
end

#execute(input, output) ⇒ Object



12
13
14
15
16
# File 'lib/tlog/command/owner.rb', line 12

def execute(input, output)
  new_owner = input.args[0]
  updated_log = change_owner(new_owner)
  output.line("Changed owner of '#{updated_log.name}' to #{new_owner}")
end

#nameObject



4
5
6
# File 'lib/tlog/command/owner.rb', line 4

def name 
  "owner"
end

#options(parser, options) ⇒ Object



18
19
20
# File 'lib/tlog/command/owner.rb', line 18

def options(parser, options)
  parser.banner = "usage: tlog owner <new_owner>"
end