Class: PagerDuty::ExternalServices::Response
- Inherits:
-
Response
- Object
- Common::Base
- Response
- PagerDuty::ExternalServices::Response
- Defined in:
- lib/pagerduty/external_services/response.rb
Instance Attribute Summary
Attributes inherited from Common::Base
Class Method Summary collapse
-
.from(raw_response) ⇒ PagerDuty::ExternalServices::Response
An instance of this class.
Methods inherited from Response
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes
Constructor Details
This class inherits a constructor from PagerDuty::Response
Class Method Details
.from(raw_response) ⇒ PagerDuty::ExternalServices::Response
Returns An instance of this class.
19 20 21 22 23 24 25 26 27 |
# File 'lib/pagerduty/external_services/response.rb', line 19 def self.from(raw_response) services = raw_response&.body&.dig('services').presence || [] new( raw_response&.status, reported_at: Time.current.iso8601, statuses: PagerDuty::Models::Service.statuses_for(services).map(&:to_h) ) end |