Sha256: e1698fe437b80aca63dc4c4552ab473a39778f1fa9d067a8cc5b982fa6001007

Contents?: true

Size: 656 Bytes

Versions: 31

Compression:

Stored size: 656 Bytes

Contents

module Awspec::Type
  class Vpc < Base
    attr_reader :client

    def initialize(id)
      super
      @client = @ec2_client
      @resource = find_vpc(id)
      @id = @resource[:vpc_id] if @resource
    end

    states = %w(
      available pending
    )

    states.each do |state|
      define_method state + '?' do
        @resource[:state] == state
      end
    end

    def has_route_table?(id)
      route_table = find_route_table(id)
      return false unless route_table
      route_table[:vpc_id] == @id
    end

    def has_network_acl?(id)
      n = find_network_acl(id)
      return false unless n
      n[:vpc_id] == @id
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
awspec-0.14.1 lib/awspec/type/vpc.rb
awspec-0.14.0 lib/awspec/type/vpc.rb
awspec-0.13.0 lib/awspec/type/vpc.rb
awspec-0.12.1 lib/awspec/type/vpc.rb
awspec-0.12.0 lib/awspec/type/vpc.rb
awspec-0.11.0 lib/awspec/type/vpc.rb
awspec-0.10.2 lib/awspec/type/vpc.rb
awspec-0.10.1 lib/awspec/type/vpc.rb
awspec-0.10.0 lib/awspec/type/vpc.rb
awspec-0.9.0 lib/awspec/type/vpc.rb
awspec-0.8.1 lib/awspec/type/vpc.rb