Class: CloudhouseGuardian::Incident
- Inherits:
-
BaseObject
- Object
- BaseObject
- CloudhouseGuardian::Incident
- Defined in:
- lib/cloudhouse_guardian/Incident.rb
Instance Attribute Summary collapse
-
#ended_at ⇒ Object
Returns the value of attribute ended_at.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#short_description ⇒ Object
Returns the value of attribute short_description.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from BaseObject
#appliance_api_key, #appliance_url, #insecure, #sec_key
Instance Method Summary collapse
- #from_hash(h) ⇒ Object
-
#initialize(appliance_url, appliance_api_key, sec_key, insecure = false) ⇒ Incident
constructor
A new instance of Incident.
- #to_hash ⇒ Object
- #to_json(options = nil) ⇒ Object
Methods inherited from BaseObject
#http_delete, #http_get, #http_post, #http_put, #make_headers
Constructor Details
#initialize(appliance_url, appliance_api_key, sec_key, insecure = false) ⇒ Incident
Returns a new instance of Incident.
9 10 11 12 13 14 15 16 17 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 9 def initialize(appliance_url, appliance_api_key, sec_key, insecure = false) super(appliance_url, appliance_api_key, sec_key, insecure) self.ended_at = nil self.external_id = nil self.id = nil self.short_description = nil self.started_at = nil self.url = nil end |
Instance Attribute Details
#ended_at ⇒ Object
Returns the value of attribute ended_at.
3 4 5 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 3 def ended_at @ended_at end |
#external_id ⇒ Object
Returns the value of attribute external_id.
4 5 6 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 4 def external_id @external_id end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 5 def id @id end |
#short_description ⇒ Object
Returns the value of attribute short_description.
6 7 8 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 6 def short_description @short_description end |
#started_at ⇒ Object
Returns the value of attribute started_at.
7 8 9 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 7 def started_at @started_at end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 8 def url @url end |
Instance Method Details
#from_hash(h) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 19 def from_hash(h) self.ended_at = h['ended_at'] if h.include?('ended_at') self.external_id = h['external_id'] if h.include?('external_id') self.id = h['id'] if h.include?('id') self.short_description = h['short_description'] if h.include?('short_description') self.started_at = h['started_at'] if h.include?('started_at') self.url = h['url'] if h.include?('url') end |
#to_hash ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 27 def to_hash h = {} h['ended_at'] = self.ended_at h['external_id'] = self.external_id h['id'] = self.id h['short_description'] = self.short_description h['started_at'] = self.started_at h['url'] = self.url return h end |
#to_json(options = nil) ⇒ Object
37 38 39 40 |
# File 'lib/cloudhouse_guardian/Incident.rb', line 37 def to_json( = nil) h = to_hash return h.to_json() end |