Class: Checkoff::QuickaddSubcommand
- Inherits:
-
Object
- Object
- Checkoff::QuickaddSubcommand
- Defined in:
- lib/checkoff/cli.rb
Overview
CLI subcommand that creates a task
Instance Method Summary collapse
-
#initialize(workspace_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config:), tasks: Checkoff::Tasks.new(config:)) ⇒ QuickaddSubcommand
constructor
A new instance of QuickaddSubcommand.
- #run ⇒ void
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.
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
#run ⇒ void
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 |