Method: Apidae::Selection#api_objects

Defined in:
app/models/apidae/selection.rb

#api_objects(opts = {}) ⇒ Object



93
94
95
96
97
98
99
100
101
102
# File 'app/models/apidae/selection.rb', line 93

def api_objects(opts = {})
  key = cache_key(:objects)
  res = $apidae_cache.read(key)
  unless res
    query_args = build_args(OBJECTS_ENDPOINT, opts.merge({selection_ids: [apidae_id]}))
    res = query_api(query_args, true, false)
    $apidae_cache.write(key, res)
  end
  res
end