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