Class: EbsPruneSnapshot::Snapshot
- Inherits:
-
Object
- Object
- EbsPruneSnapshot::Snapshot
- Defined in:
- lib/ebs_prune_snapshot.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#snapshot_id ⇒ Object
readonly
Returns the value of attribute snapshot_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#volume_id ⇒ Object
readonly
Returns the value of attribute volume_id.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #completed? ⇒ Boolean
- #date ⇒ Object
-
#initialize(params = {}) ⇒ Snapshot
constructor
A new instance of Snapshot.
Constructor Details
#initialize(params = {}) ⇒ Snapshot
Returns a new instance of Snapshot.
212 213 214 215 216 217 |
# File 'lib/ebs_prune_snapshot.rb', line 212 def initialize(params={}) @snapshot_id = params['snapshotId'] @volume_id = params['volumeId'] @status = params['status'] @created_at = Time.parse(params['startTime']).utc end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
210 211 212 |
# File 'lib/ebs_prune_snapshot.rb', line 210 def created_at @created_at end |
#snapshot_id ⇒ Object (readonly)
Returns the value of attribute snapshot_id.
210 211 212 |
# File 'lib/ebs_prune_snapshot.rb', line 210 def snapshot_id @snapshot_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
210 211 212 |
# File 'lib/ebs_prune_snapshot.rb', line 210 def status @status end |
#volume_id ⇒ Object (readonly)
Returns the value of attribute volume_id.
210 211 212 |
# File 'lib/ebs_prune_snapshot.rb', line 210 def volume_id @volume_id end |
Instance Method Details
#<=>(other) ⇒ Object
223 224 225 |
# File 'lib/ebs_prune_snapshot.rb', line 223 def <=>(other) created_at <=> other.created_at end |
#completed? ⇒ Boolean
219 220 221 |
# File 'lib/ebs_prune_snapshot.rb', line 219 def completed? status == 'completed' end |
#date ⇒ Object
227 228 229 |
# File 'lib/ebs_prune_snapshot.rb', line 227 def date created_at.strftime("%Y%m%d") end |