Class: Checkoff::QuickaddSubcommand

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

Overview

CLI subcommand that creates a task

Instance Attribute Summary collapse

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:)) ⇒ Object

@param workspace_name

@param task_name

@param config

@param workspaces

@param tasks



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

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 Attribute Details

#task_nameObject (readonly)

Returns the value of attribute task_name.

Returns:

  • (Object)


224
225
226
# File 'sig/checkoff.rbs', line 224

def task_name
  @task_name
end

#workspace_nameObject (readonly)

Returns the value of attribute workspace_name.

Returns:

  • (Object)


221
222
223
# File 'sig/checkoff.rbs', line 221

def workspace_name
  @workspace_name
end

Instance Method Details

#runvoid

This method returns an undefined value.



294
295
296
297
298
# File 'lib/checkoff/cli.rb', line 294

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