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: config), tasks: Checkoff::Tasks.new(config: config)) ⇒ QuickaddSubcommand
constructor
A new instance of QuickaddSubcommand.
- #run ⇒ Object
Constructor Details
#initialize(workspace_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config: config), tasks: Checkoff::Tasks.new(config: config)) ⇒ QuickaddSubcommand
Returns a new instance of QuickaddSubcommand.
203 204 205 206 207 208 209 210 211 |
# File 'lib/checkoff/cli.rb', line 203 def initialize(workspace_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config: config), tasks: Checkoff::Tasks.new(config: config)) @workspace_name = workspace_name @task_name = task_name @workspaces = workspaces @tasks = tasks end |
Instance Method Details
#run ⇒ Object
213 214 215 216 217 |
# File 'lib/checkoff/cli.rb', line 213 def run workspace = @workspaces.workspace_or_raise(workspace_name) @tasks.add_task(task_name, workspace_gid: workspace.gid) end |