Class: Codat::Models::Integration

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/codat/models/integration.rb

Constant Summary collapse

ENDPOINT =
'/integrations'

Class Method Summary collapse

Methods inherited from BaseModel

attributes, #format_url, format_url, get, #get, #initialize, post, #post, successful_response?

Constructor Details

This class inherits a constructor from Codat::BaseModel

Class Method Details

.all(params = {}) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/codat/models/integration.rb', line 12

def self.all(params = {})
  result = get(ENDPOINT, params)

  return [] unless successful_response?(result)

  result.body.fetch(:results, []).map { |integration| new(json: integration) }
end