Class: Rudy::AWS::EC2::Snapshot

Inherits:
Storable
  • Object
show all
Defined in:
lib/rudy/aws/ec2/snapshot.rb

Constant Summary collapse

@@sformat =
"%s <- %10s; %s"

Instance Method Summary collapse

Instance Method Details

#completed?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/rudy/aws/ec2/snapshot.rb', line 35

def completed?
  self.status && self.status == 'completed'
end

#inspectObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/rudy/aws/ec2/snapshot.rb', line 24

def inspect
  lines = []
  lines << liner_note
  field_names.each do |key|
    next unless self.respond_to?(key)
    val = self.send(key)
    lines << sprintf(" %22s: %s", key, (val.is_a?(Array) ? val.join(', ') : val))
  end
  lines.join($/)
end

#liner_noteObject



14
15
16
17
18
# File 'lib/rudy/aws/ec2/snapshot.rb', line 14

def liner_note
  t = Time.parse(@created)
  info = t.strftime("%Y-%m-%d %H:%M:%S")
  "%s (%s)" % [(self.awsid || '').bright, info]
end

#to_s(with_title = false) ⇒ Object



20
21
22
# File 'lib/rudy/aws/ec2/snapshot.rb', line 20

def to_s(with_title=false)
  @@sformat % [liner_note,  @volid, @status]
end