Module: AwsExtensions::EC2::Volume
- Defined in:
- lib/aws_extensions/ec2/Volume.rb
Instance Method Summary collapse
-
#attached? ⇒ Boolean
Public: Returns true if the volume is attached or attaching to anything.
-
#detached? ⇒ Boolean
Public: Returns true if the volume is not attached or attaching to anything.
-
#group ⇒ Object
Public: Returns the value of the “Group” tag for the Volume.
Instance Method Details
#attached? ⇒ Boolean
Public: Returns true if the volume is attached or attaching to anything
13 14 15 |
# File 'lib/aws_extensions/ec2/Volume.rb', line 13 def attached? self..map(&:state).any? { |state| state == "attached" || state == "attaching" } end |
#detached? ⇒ Boolean
Public: Returns true if the volume is not attached or attaching to anything
18 19 20 |
# File 'lib/aws_extensions/ec2/Volume.rb', line 18 def detached? !self.attached? end |
#group ⇒ Object
Public: Returns the value of the “Group” tag for the Volume
6 7 8 9 10 |
# File 'lib/aws_extensions/ec2/Volume.rb', line 6 def group self..select { |tag| tag.key == "Group" }.first.value rescue nil end |