Class: EbsPruneSnapshot::Snapshot

Inherits:
Object
  • Object
show all
Defined in:
lib/ebs_prune_snapshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject (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_idObject (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

#statusObject (readonly)

Returns the value of attribute status.



210
211
212
# File 'lib/ebs_prune_snapshot.rb', line 210

def status
  @status
end

#volume_idObject (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

Returns:

  • (Boolean)


219
220
221
# File 'lib/ebs_prune_snapshot.rb', line 219

def completed?
  status == 'completed'
end

#dateObject



227
228
229
# File 'lib/ebs_prune_snapshot.rb', line 227

def date
  created_at.strftime("%Y%m%d")
end