Class: Checkoff::QuickaddSubcommand

Inherits:
Object
  • Object
show all
Defined in:
lib/checkoff/cli.rb

Overview

CLI subcommand that creates a task

Instance Method Summary collapse

Constructor Details

#initialize(workspace_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config:), tasks: Checkoff::Tasks.new(config:)) ⇒ QuickaddSubcommand

Returns a new instance of QuickaddSubcommand.

Parameters:



272
273
274
275
276
277
278
279
280
# File 'lib/checkoff/cli.rb', line 272

def initialize(workspace_name, task_name,
               config: Checkoff::Internal::ConfigLoader.load(:asana),
               workspaces: Checkoff::Workspaces.new(config:),
               tasks: Checkoff::Tasks.new(config:))
  @workspace_name = workspace_name
  @task_name = task_name
  @workspaces = workspaces
  @tasks = tasks
end

Instance Method Details

#runvoid

This method returns an undefined value.



283
284
285
286
287
# File 'lib/checkoff/cli.rb', line 283

def run
  workspace = @workspaces.workspace_or_raise(workspace_name)
  @tasks.add_task(task_name,
                  workspace_gid: workspace.gid)
end