Class: Checkoff::ViewSubcommand
- Inherits:
-
Object
- Object
- Checkoff::ViewSubcommand
- Defined in:
- lib/checkoff/cli.rb
Overview
CLI subcommand that shows tasks in JSON form
Instance Method Summary collapse
-
#initialize(workspace_name, project_name, section_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), projects: Checkoff::Projects.new(config: config), sections: Checkoff::Sections.new(config: config, projects: projects), tasks: Checkoff::Tasks.new(config: config, sections: sections), stderr: $stderr) ⇒ ViewSubcommand
constructor
A new instance of ViewSubcommand.
- #run ⇒ Object
Constructor Details
#initialize(workspace_name, project_name, section_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), projects: Checkoff::Projects.new(config: config), sections: Checkoff::Sections.new(config: config, projects: projects), tasks: Checkoff::Tasks.new(config: config, sections: sections), stderr: $stderr) ⇒ ViewSubcommand
Returns a new instance of ViewSubcommand.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/checkoff/cli.rb', line 123 def initialize(workspace_name, project_name, section_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), projects: Checkoff::Projects.new(config: config), sections: Checkoff::Sections.new(config: config, projects: projects), tasks: Checkoff::Tasks.new(config: config, sections: sections), stderr: $stderr) @workspace_name = workspace_name @stderr = stderr validate_and_assign_project_name(project_name) @section_name = section_name @task_name = task_name @sections = sections @tasks = tasks end |
Instance Method Details
#run ⇒ Object
141 142 143 144 145 146 147 148 149 |
# File 'lib/checkoff/cli.rb', line 141 def run if section_name.nil? run_on_project(workspace_name, project_name) elsif task_name.nil? run_on_section(workspace_name, project_name, section_name) else run_on_task(workspace_name, project_name, section_name, task_name) end end |