Class: Rudy::AWS::EC2::Volume
- Inherits:
-
Storable
- Object
- Storable
- Rudy::AWS::EC2::Volume
- Defined in:
- lib/rudy/aws/ec2/volume.rb
Constant Summary collapse
- @@sformat =
cram the terabyte
"%s %10s;%4sGB; %s "
Instance Method Summary collapse
- #attached? ⇒ Boolean
- #available? ⇒ Boolean
- #creating? ⇒ Boolean
- #deleting? ⇒ Boolean
- #in_use? ⇒ Boolean
- #inspect ⇒ Object
- #liner_note ⇒ Object
-
#state ⇒ Object
Alias for status.
- #to_s(with_title = false) ⇒ Object
Instance Method Details
#attached? ⇒ Boolean
45 |
# File 'lib/rudy/aws/ec2/volume.rb', line 45 def attached?; (status && status == "attached"); end |
#available? ⇒ Boolean
42 |
# File 'lib/rudy/aws/ec2/volume.rb', line 42 def available?; (status && status == "available"); end |
#creating? ⇒ Boolean
43 |
# File 'lib/rudy/aws/ec2/volume.rb', line 43 def creating?; (status && status == "creating"); end |
#deleting? ⇒ Boolean
44 |
# File 'lib/rudy/aws/ec2/volume.rb', line 44 def deleting?; (status && status == "deleting"); end |
#in_use? ⇒ Boolean
46 |
# File 'lib/rudy/aws/ec2/volume.rb', line 46 def in_use?; (status && status == "in-use"); end |
#inspect ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/rudy/aws/ec2/volume.rb', line 29 def inspect lines = [liner_note] field_names.each do |n| lines << sprintf(" %12s: %s", n, self.send(n)) if self.send(n) end lines.join($/) end |
#liner_note ⇒ Object
18 19 20 21 |
# File 'lib/rudy/aws/ec2/volume.rb', line 18 def liner_note info = attached? ? "attached to #{@instid}" : @status "%s (%s)" % [(self.awsid || '').bright, info] end |
#state ⇒ Object
Alias for status
38 39 40 |
# File 'lib/rudy/aws/ec2/volume.rb', line 38 def state status end |
#to_s(with_title = false) ⇒ Object
23 24 25 26 27 |
# File 'lib/rudy/aws/ec2/volume.rb', line 23 def to_s(with_title=false) line = @@sformat % [liner_note, @zone, @size, @device] line << " <- %s" % [@snapid] if @snapid line end |