Sha256: aa3744300f83e9698c6f1e4cd306895c8c653c82951a1e86f20c2c60bd11e575

Contents?: true

Size: 794 Bytes

Versions: 17

Compression:

Stored size: 794 Bytes

Contents

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

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

    states = %w(
      available pending
    )

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

    def method_missing(name)
      describe = name.to_s
      if @vpc.key?(describe)
        @vpc[describe]
      else
        super
      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

17 entries across 17 versions & 1 rubygems

Version Path
awspec-0.8.0 lib/awspec/type/vpc.rb
awspec-0.7.0 lib/awspec/type/vpc.rb
awspec-0.6.4 lib/awspec/type/vpc.rb
awspec-0.6.3 lib/awspec/type/vpc.rb
awspec-0.6.2 lib/awspec/type/vpc.rb
awspec-0.6.1 lib/awspec/type/vpc.rb
awspec-0.6.0 lib/awspec/type/vpc.rb
awspec-0.5.0 lib/awspec/type/vpc.rb
awspec-0.4.1 lib/awspec/type/vpc.rb
awspec-0.4.0 lib/awspec/type/vpc.rb
awspec-0.3.0 lib/awspec/type/vpc.rb
awspec-0.2.3 lib/awspec/type/vpc.rb
awspec-0.2.2 lib/awspec/type/vpc.rb
awspec-0.2.1 lib/awspec/type/vpc.rb
awspec-0.2.0 lib/awspec/type/vpc.rb
awspec-0.1.1 lib/awspec/type/vpc.rb
awspec-0.1.0 lib/awspec/type/vpc.rb