Class: Abt::Providers::Asana::Services::TaskPicker

Inherits:
Object
  • Object
show all
Defined in:
lib/abt/providers/asana/services/task_picker.rb

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli:, path:, config:, project:) ⇒ TaskPicker

Returns a new instance of TaskPicker.



23
24
25
26
27
28
# File 'lib/abt/providers/asana/services/task_picker.rb', line 23

def initialize(cli:, path:, config:, project:)
  @cli = cli
  @path = path
  @config = config
  @project = project
end

Instance Attribute Details

#cliObject (readonly)

Returns the value of attribute cli.



21
22
23
# File 'lib/abt/providers/asana/services/task_picker.rb', line 21

def cli
  @cli
end

#configObject (readonly)

Returns the value of attribute config.



21
22
23
# File 'lib/abt/providers/asana/services/task_picker.rb', line 21

def config
  @config
end

#pathObject (readonly)

Returns the value of attribute path.



21
22
23
# File 'lib/abt/providers/asana/services/task_picker.rb', line 21

def path
  @path
end

#projectObject (readonly)

Returns the value of attribute project.



21
22
23
# File 'lib/abt/providers/asana/services/task_picker.rb', line 21

def project
  @project
end

Class Method Details

.call(**args) ⇒ Object



17
18
19
# File 'lib/abt/providers/asana/services/task_picker.rb', line 17

def self.call(**args)
  new(**args).call
end

Instance Method Details

#callObject



30
31
32
33
34
35
36
# File 'lib/abt/providers/asana/services/task_picker.rb', line 30

def call
  task = select_task

  path_with_task = Path.from_gids(project_gid: path.project_gid, task_gid: task["gid"])

  Result.new(task: task, path: path_with_task)
end