Class: Fog::Parsers::AWS::Elasticache::EngineDefaultsParser

Inherits:
Base
  • Object
show all
Defined in:
lib/rackspace-fog/aws/parsers/elasticache/engine_defaults_parser.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#attr_value, #characters, #initialize, #value

Constructor Details

This class inherits a constructor from Fog::Parsers::Base

Instance Method Details

#end_element(name) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/rackspace-fog/aws/parsers/elasticache/engine_defaults_parser.rb', line 34

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

#resetObject



9
10
11
12
# File 'lib/rackspace-fog/aws/parsers/elasticache/engine_defaults_parser.rb', line 9

def reset
  super
  reset_engine_defaults
end

#reset_engine_defaultsObject



14
15
16
17
18
19
# File 'lib/rackspace-fog/aws/parsers/elasticache/engine_defaults_parser.rb', line 14

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

#start_element(name, attrs = []) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rackspace-fog/aws/parsers/elasticache/engine_defaults_parser.rb', line 21

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