Class: PagerDuty::Response

Inherits:
Common::Base show all
Includes:
ActiveModel::Validations
Defined in:
lib/pagerduty/response.rb

Direct Known Subclasses

ExternalServices::Response

Instance Attribute Summary

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes

Constructor Details

#initialize(status, attributes = nil) ⇒ Response

Returns a new instance of Response.



11
12
13
14
# File 'lib/pagerduty/response.rb', line 11

def initialize(status, attributes = nil)
  super(attributes) if attributes
  self.status = status
end

Instance Method Details

#cache?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pagerduty/response.rb', line 20

def cache?
  ok?
end

#ok?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pagerduty/response.rb', line 16

def ok?
  status == 200
end