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:), sections: Checkoff::Sections.new(config:, projects:), tasks: Checkoff::Tasks.new(config:, sections:), stderr: $stderr) ⇒ ViewSubcommand
constructor
A new instance of ViewSubcommand.
- #run ⇒ void
Constructor Details
#initialize(workspace_name, project_name, section_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), projects: Checkoff::Projects.new(config:), sections: Checkoff::Sections.new(config:, projects:), tasks: Checkoff::Tasks.new(config:, sections:), stderr: $stderr) ⇒ ViewSubcommand
Returns a new instance of ViewSubcommand.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/checkoff/cli.rb', line 168 def initialize(workspace_name, project_name, section_name, task_name, config: Checkoff::Internal::ConfigLoader.load(:asana), projects: Checkoff::Projects.new(config:), sections: Checkoff::Sections.new(config:, projects:), tasks: Checkoff::Tasks.new(config:, 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 ⇒ void
This method returns an undefined value.
187 188 189 190 191 192 193 194 195 |
# File 'lib/checkoff/cli.rb', line 187 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 |