Class: Rollo::Model::ScalingActivity
- Inherits:
-
Object
- Object
- Rollo::Model::ScalingActivity
- Defined in:
- lib/rollo/model/scaling_activity.rb
Instance Method Summary collapse
- #end_time ⇒ Object
- #id ⇒ Object
-
#initialize(activity) ⇒ ScalingActivity
constructor
A new instance of ScalingActivity.
- #is_complete? ⇒ Boolean
- #start_time ⇒ Object
- #started_after_completion_of?(other) ⇒ Boolean
Constructor Details
#initialize(activity) ⇒ ScalingActivity
Returns a new instance of ScalingActivity.
4 5 6 |
# File 'lib/rollo/model/scaling_activity.rb', line 4 def initialize(activity) @activity = activity end |
Instance Method Details
#end_time ⇒ Object
16 17 18 |
# File 'lib/rollo/model/scaling_activity.rb', line 16 def end_time @activity.end_time end |
#id ⇒ Object
8 9 10 |
# File 'lib/rollo/model/scaling_activity.rb', line 8 def id @activity.activity_id end |
#is_complete? ⇒ Boolean
27 28 29 |
# File 'lib/rollo/model/scaling_activity.rb', line 27 def is_complete? %w(Successful Failed Cancelled).include?(@activity.status_code) end |
#start_time ⇒ Object
12 13 14 |
# File 'lib/rollo/model/scaling_activity.rb', line 12 def start_time @activity.start_time end |
#started_after_completion_of?(other) ⇒ Boolean
20 21 22 23 24 25 |
# File 'lib/rollo/model/scaling_activity.rb', line 20 def started_after_completion_of?(other) self.id != other.id && !self.start_time.nil? && !other.end_time.nil? && self.start_time > other.end_time end |