Sha256: 1e3e0f880496cad38e4820991c6e8f1845f3928268106cfef9ad5ea165c367a4

Contents?: true

Size: 574 Bytes

Versions: 22

Compression:

Stored size: 574 Bytes

Contents

module Awspec::Type
  class RouteTable < Base
    def initialize(id)
      super
      @resource = find_route_table(id)
      @id = @resource[:route_table_id] if @resource
    end

    def has_route?(target, destination = nil)
      @resource.routes.find do |route|
        if destination
          next false unless route.destination_cidr_block == destination
        end
        next true if route.gateway_id == target
        igw = find_internet_gateway(target)
        next true if igw.internet_gateway_id == target || igw.tag_name == target
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
awspec-0.20.2 lib/awspec/type/route_table.rb
awspec-0.20.1 lib/awspec/type/route_table.rb
awspec-0.20.0 lib/awspec/type/route_table.rb
awspec-0.19.0 lib/awspec/type/route_table.rb
awspec-0.18.2 lib/awspec/type/route_table.rb
awspec-0.18.1 lib/awspec/type/route_table.rb
awspec-0.18.0 lib/awspec/type/route_table.rb
awspec-0.17.1 lib/awspec/type/route_table.rb
awspec-0.17.0 lib/awspec/type/route_table.rb
awspec-0.16.0 lib/awspec/type/route_table.rb
awspec-0.15.0 lib/awspec/type/route_table.rb
awspec-0.14.1 lib/awspec/type/route_table.rb
awspec-0.14.0 lib/awspec/type/route_table.rb
awspec-0.13.0 lib/awspec/type/route_table.rb
awspec-0.12.1 lib/awspec/type/route_table.rb
awspec-0.12.0 lib/awspec/type/route_table.rb
awspec-0.11.0 lib/awspec/type/route_table.rb
awspec-0.10.2 lib/awspec/type/route_table.rb
awspec-0.10.1 lib/awspec/type/route_table.rb
awspec-0.10.0 lib/awspec/type/route_table.rb