Method: WorkGuide::CLI#update

Defined in:
lib/work_guide/cli.rb

#update(index = nil) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/work_guide/cli.rb', line 24

def update(index = nil)
  index = boot_peco(all: true) unless index.present?
  guide = Guide.all[index.to_i]
  guide.priority = options[:priority] if options[:priority]
  guide.cycle = options[:cycle] if options[:cycle]
  guide.week_start = options[:week_start] if options[:week_start]
  Guide.save
  puts "Update [#{index}]#{guide}"
end