Sha256: 1066283e65f8640e16ef6aed0e83b97cf180f707a4590799da24662dbfe0a3cc
Contents?: true
Size: 792 Bytes
Versions: 10
Compression:
Stored size: 792 Bytes
Contents
module Awspec::Type class Ebs < Base aws_resource Aws::EC2::Volume def initialize(id) super @resource_via_client = find_ebs(id) @id = @resource_via_client[:volume_id] if @resource_via_client end STATES = %w( creating available in-use deleting deleted error ) STATES.each do |state| define_method state.tr('-', '_') + '?' do @resource_via_client[:state] == state end end def attached_to?(instance_id) instance = find_ec2(instance_id) return false unless instance return false unless @resource_via_client[:attachments] @resource_via_client[:attachments][0][:instance_id] == instance[:instance_id] && \ @resource_via_client[:attachments][0][:state] == 'attached' end end end
Version data entries
10 entries across 10 versions & 1 rubygems