Sha256: b1b4cae75684c512737eb3e3c797c88fdcb5f4c2ed3b3c5c46fb841ab5342a5a

Contents?: true

Size: 857 Bytes

Versions: 46

Compression:

Stored size: 857 Bytes

Contents

module Awspec::Type
  class Sqs < ResourceBase
    def resource_via_client
      return @resource_via_client if @resource_via_client
      queue_url = id
      attributes = {}
      res = sqs_client.get_queue_attributes({
                                              queue_url: queue_url,
                                              attribute_names: ['All']
                                            })
      res.attributes.each do |key, value|
        attributes[key.underscore] = value
      end
      attributes['queue_url'] = queue_url
      @resource_via_client ||= attributes
    end

    def id
      @id ||= find_queue(@display_name)
    end

    def method_missing(name)
      param_name = name.to_s
      if resource_via_client.include?(param_name)
        resource_via_client[param_name]
      else
        super
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
awspec-1.12.3 lib/awspec/type/sqs.rb
awspec-1.12.2 lib/awspec/type/sqs.rb
awspec-1.12.1 lib/awspec/type/sqs.rb
awspec-1.12.0 lib/awspec/type/sqs.rb
awspec-1.11.1 lib/awspec/type/sqs.rb
awspec-1.11.0 lib/awspec/type/sqs.rb
awspec-1.10.0 lib/awspec/type/sqs.rb
awspec-1.9.0 lib/awspec/type/sqs.rb
awspec-1.8.0 lib/awspec/type/sqs.rb
awspec-1.7.0 lib/awspec/type/sqs.rb
awspec-1.6.1 lib/awspec/type/sqs.rb
awspec-1.6.0 lib/awspec/type/sqs.rb
awspec-1.5.4 lib/awspec/type/sqs.rb
awspec-1.5.3 lib/awspec/type/sqs.rb
awspec-1.5.2 lib/awspec/type/sqs.rb
awspec-1.5.1 lib/awspec/type/sqs.rb
awspec-1.5.0 lib/awspec/type/sqs.rb
awspec-1.4.3 lib/awspec/type/sqs.rb
awspec-1.4.2 lib/awspec/type/sqs.rb
awspec-1.4.1 lib/awspec/type/sqs.rb