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