Class: Checkoff::Internal::ProjectHashes

Inherits:
Object
  • Object
show all
Defined in:
lib/checkoff/internal/project_hashes.rb

Overview

Builds on the standard API representation of an Asana project with some convenience keys.

Instance Method Summary collapse

Constructor Details

#initialize(_deps = {}) ⇒ ProjectHashes



10
# File 'lib/checkoff/internal/project_hashes.rb', line 10

def initialize(_deps = {}); end

Instance Method Details

#project_to_h(project_obj, project: :not_specified) ⇒ Hash



16
17
18
19
20
21
22
# File 'lib/checkoff/internal/project_hashes.rb', line 16

def project_to_h(project_obj, project: :not_specified)
  project = project_obj.name if project == :not_specified
  project_hash = { **project_obj.to_h, 'project' => project }
  project_hash['unwrapped'] = {}
  unwrap_custom_fields(project_hash)
  project_hash
end