Sha256: 5a5db4f2ce9fad4fa5886a73ebbda4d24a6b68ae4a6ec71141a3d5a00b978e97

Contents?: true

Size: 529 Bytes

Versions: 10

Compression:

Stored size: 529 Bytes

Contents

module Awspec::Type
  class Subnet < Base
    attr_reader :subnet

    def initialize(id)
      super
      @subnet = find_subnet(id)
      @id = @subnet[:subnet_id] if @subnet
    end

    states = %w(
      available pending
    )

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

    def method_missing(name)
      describe = name.to_sym
      if @subnet.members.include?(describe)
        @subnet[describe]
      else
        super
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
awspec-0.8.0 lib/awspec/type/subnet.rb
awspec-0.7.0 lib/awspec/type/subnet.rb
awspec-0.6.4 lib/awspec/type/subnet.rb
awspec-0.6.3 lib/awspec/type/subnet.rb
awspec-0.6.2 lib/awspec/type/subnet.rb
awspec-0.6.1 lib/awspec/type/subnet.rb
awspec-0.6.0 lib/awspec/type/subnet.rb
awspec-0.5.0 lib/awspec/type/subnet.rb
awspec-0.4.1 lib/awspec/type/subnet.rb
awspec-0.4.0 lib/awspec/type/subnet.rb