Sha256: 50e65cf060d1fe18b7a009c19888a088e0d0c125384206ff99719d4203c5bc86

Contents?: true

Size: 820 Bytes

Versions: 3

Compression:

Stored size: 820 Bytes

Contents

module Awspec::Type
  class RdsDbParameterGroup < Base
    attr_reader :parameters

    def initialize(name)
      super
      @parameters = {}
      res = @rds_client.describe_db_parameters({
                                                 db_parameter_group_name: name
                                               })

      loop do
        res.parameters.each do |param|
          @parameters[param.parameter_name] = param.parameter_value
        end
        (res.next_page? && res = res.next_page) || break
      end

      @id = name unless @parameters.empty?
      @resource_via_client = @parameters
    end

    def method_missing(name)
      param_name = name.to_s.tr('_', '-')
      if @parameters.include?(param_name)
        @parameters[param_name].to_s
      else
        super
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
awspec-0.26.2 lib/awspec/type/rds_db_parameter_group.rb
awspec-0.26.1 lib/awspec/type/rds_db_parameter_group.rb
awspec-0.26.0 lib/awspec/type/rds_db_parameter_group.rb