Class: Updown::Downtime
- Inherits:
-
Object
- Object
- Updown::Downtime
- Defined in:
- lib/updown/downtime.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#ended_at ⇒ Object
Returns the value of attribute ended_at.
-
#error ⇒ Object
Returns the value of attribute error.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json) ⇒ Downtime
constructor
A new instance of Downtime.
Constructor Details
#initialize(json) ⇒ Downtime
Returns a new instance of Downtime.
11 12 13 14 15 16 |
# File 'lib/updown/downtime.rb', line 11 def initialize(json) @error = json['error'] @started_at = Time.parse(json['started_at']) if json['started_at'] @ended_at = Time.parse(json['ended_at']) if json['ended_at'] @duration = json['duration'] end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
3 4 5 |
# File 'lib/updown/downtime.rb', line 3 def duration @duration end |
#ended_at ⇒ Object
Returns the value of attribute ended_at.
3 4 5 |
# File 'lib/updown/downtime.rb', line 3 def ended_at @ended_at end |
#error ⇒ Object
Returns the value of attribute error.
3 4 5 |
# File 'lib/updown/downtime.rb', line 3 def error @error end |
#started_at ⇒ Object
Returns the value of attribute started_at.
3 4 5 |
# File 'lib/updown/downtime.rb', line 3 def started_at @started_at end |