Class: Checkoff::Internal::TaskHashes
- Inherits:
-
Object
- Object
- Checkoff::Internal::TaskHashes
- Defined in:
- lib/checkoff/internal/task_hashes.rb
Overview
Builds on the standard API representation of an Asana task with some convenience keys.
Instance Method Summary collapse
Instance Method Details
#h_to_task(task_data, client:) ⇒ Asana::Resources::Task
25 26 27 28 29 30 |
# File 'lib/checkoff/internal/task_hashes.rb', line 25 def h_to_task(task_data, client:) # copy of task_data without the 'unwrapped' key clean_task_data = task_data.dup clean_task_data.delete('unwrapped') Asana::Resources::Task.new(clean_task_data, client:) end |
#task_to_h(task) ⇒ Hash
11 12 13 14 15 16 17 18 19 |
# File 'lib/checkoff/internal/task_hashes.rb', line 11 def task_to_h(task) # @type [Hash] task_hash = task.to_h task_hash['unwrapped'] = {} unwrap_custom_fields(task_hash) unwrap_all_memberships(task_hash) task_hash['task'] = task.name task_hash end |