Sha256: 8c328df590fbccf066757b73ea8eea063881ce1740490643d58931dc74ec9667

Contents?: true

Size: 605 Bytes

Versions: 28

Compression:

Stored size: 605 Bytes

Contents

require 'aws-sdk'
require 'awspec/helper/finder'

module Awspec::Type
  class Base
    include Awspec::Helper::Finder
    attr_reader :id, :resource

    def initialize(id = nil)
      @display_name = id
      super
      @id = nil
    end

    def to_s
      type = self.class.name.demodulize.underscore
      "#{type} '#{@display_name}'"
    end

    def inspect
      to_s
    end

    def exists?
      @id
    end

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
awspec-0.25.3 lib/awspec/type/base.rb
awspec-0.25.2 lib/awspec/type/base.rb
awspec-0.25.1 lib/awspec/type/base.rb
awspec-0.25.0 lib/awspec/type/base.rb
awspec-0.24.2 lib/awspec/type/base.rb
awspec-0.24.1 lib/awspec/type/base.rb
awspec-0.24.0 lib/awspec/type/base.rb
awspec-0.23.0 lib/awspec/type/base.rb
awspec-0.22.1 lib/awspec/type/base.rb
awspec-0.22.0 lib/awspec/type/base.rb
awspec-0.21.6 lib/awspec/type/base.rb
awspec-0.21.5 lib/awspec/type/base.rb
awspec-0.21.4 lib/awspec/type/base.rb
awspec-0.21.3 lib/awspec/type/base.rb
awspec-0.21.2 lib/awspec/type/base.rb
awspec-0.21.1 lib/awspec/type/base.rb
awspec-0.21.0 lib/awspec/type/base.rb
awspec-0.20.2 lib/awspec/type/base.rb
awspec-0.20.1 lib/awspec/type/base.rb
awspec-0.20.0 lib/awspec/type/base.rb