Sha256: 3cc015b7b2ce6423b7b9c9eb05410a187c55a9b8f9d761537796de9bf819f9f5
Contents?: true
Size: 757 Bytes
Versions: 3
Compression:
Stored size: 757 Bytes
Contents
module Awspec::Type class Ebs < Base 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
awspec-0.26.2 | lib/awspec/type/ebs.rb |
awspec-0.26.1 | lib/awspec/type/ebs.rb |
awspec-0.26.0 | lib/awspec/type/ebs.rb |