class Dude::Commands::Start

Public Instance Methods

call(id:) click to toggle source
# File lib/dude/commands/start.rb, line 10
def call(id:)
  Commands::Move.new.call(id: id, list: selected_list('in_progress'))
  Commands::Checkout.new.call(id: id)
  Commands::Track.new.call(id: id) if time_tracking_enabled?
end

Private Instance Methods

selected_list(list) click to toggle source
# File lib/dude/commands/start.rb, line 18
def selected_list(list)
  case list
  when 'todo' then Dude::SETTINGS[:todo_list_name]
  when 'in_progress' then Dude::SETTINGS[:in_progress_list_name]
  when 'code_review' then Dude::SETTINGS[:code_review_list_name]
  when 'testing' then Dude::SETTINGS[:testing_list_name]
  when 'done' then Dude::SETTINGS[:done_list_name]
  end
end
time_tracking_enabled?() click to toggle source
# File lib/dude/commands/start.rb, line 28
def time_tracking_enabled?
  !Dude::SETTINGS.dig(:toggl, :token).nil?
end