Class: Nylas::JobStatusCollection

Inherits:
Collection show all
Defined in:
lib/nylas/job_status_collection.rb

Overview

Additional methods for some of Calendar’s other functionality

Instance Attribute Summary

Attributes inherited from Collection

#api, #constraints, #model

Instance Method Summary collapse

Methods inherited from Collection

#count, #create, #each, #execute, #expanded, #find, #find_each, #find_raw, #ids, #initialize, #limit, #more_pages?, #new, #next_page, #offset, #raw, #resources_path, #search, #to_be_executed, #where

Constructor Details

This class inherits a constructor from Nylas::Collection

Instance Method Details

#find_model(id) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/nylas/job_status_collection.rb', line 7

def find_model(id)
  response = api.execute(
    **to_be_executed.merge(
      path: "#{resources_path}/#{id}",
      query: view_query
    )
  )

  object_type = response[:object]
  return OutboxJobStatus.from_hash(response, api: api) if object_type == "message"

  model.from_hash(response, api: api)
end