Sha256: dd17853ed9acd677ae5d2e17e5fe97f7cb035c03e6f15bdf6eac78c8a2f0b6d5

Contents?: true

Size: 1.69 KB

Versions: 29

Compression:

Stored size: 1.69 KB

Contents

module Fog
  module Parsers
    module AWS
      module Elasticache
        require 'fog/aws/parsers/elasticache/base'

        class EngineDefaultsParser < Base

          def reset
            super
            reset_engine_defaults
          end

          def reset_engine_defaults
            @engine_defaults = {
              'CacheNodeTypeSpecificParameters' => [],
              'Parameters'                      => [],
            }
          end

          def start_element(name, attrs = [])
            case name
            when 'CacheNodeTypeSpecificParameter', 'Parameter'
              @parameter = {}
            when 'CacheNodeTypeSpecificValues'
              @parameter[name] = []
            when 'CacheNodeTypeSpecificValue'
              @node_specific_value = {}
            else
              super
            end
          end

          def end_element(name)
            case name
            when 'CacheParameterGroupFamily'
              @engine_defaults[name] = value
            when 'CacheNodeTypeSpecificParameter', 'Parameter'
              if not @parameter.empty?
                @engine_defaults["#{name}s"] << @parameter
              end
            when 'AllowedValues', 'DataType', 'Description', 'IsModifiable',
              'MinimumEngineVersion', 'ParameterName', 'Source'
              @parameter[name] = value
            when 'CacheNodeType', 'Value'
              @node_specific_value[name] = value
            when 'CacheNodeTypeSpecificValue'
              if not @node_specific_value.empty?
                @parameter["#{name}s"] << @node_specific_value
              end
            else
              super
            end
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 9 rubygems

Version Path
fog-parser-fix-1.6.1 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-test-again-1.6.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-parser-fix-1.6.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-1.6.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-1.5.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-1.4.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
michiels-fog-1.3.1 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-1.3.1 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-1.3.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
fog-1.2.0 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
ktheory-fog-1.1.2 lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/elasticache/engine_defaults_parser.rb