Class: Fog::Parsers::DNS::AWS::ListResourceRecordSets

Inherits:
Base
  • Object
show all
Defined in:
lib/fog/aws/parsers/dns/list_resource_record_sets.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary (collapse)

Methods inherited from Base

#attr_value, #characters, #end_element_namespace, #initialize, #start_element, #start_element_namespace, #value

Constructor Details

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

Instance Method Details

- (Object) end_element(name)



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fog/aws/parsers/dns/list_resource_record_sets.rb', line 17

def end_element(name)
  if @section == :resource_record_set
    case name
    when 'Type', 'TTL', 'SetIdentifier', 'Weight', 'Region', 'HealthCheckId', 'Failover'
      @resource_record_set[name] = value
    when 'Name'
      @resource_record_set[name] = value.gsub('\\052', '*')
    when 'Value'
      @resource_record_set['ResourceRecords'] << value
    when 'AliasTarget'
      @resource_record_set[name] = @alias_target
      @alias_target = {}
    when 'HostedZoneId', 'DNSName', 'EvaluateTargetHealth'
      @alias_target[name] = value
    when 'GeoLocation'
      @resource_record_set[name] = @geo_location
      @geo_location = {}
    when 'ContinentCode', 'CountryCode', 'SubdivisionCode'
      @geo_location[name] = value
    when 'ResourceRecordSet'
      @response['ResourceRecordSets'] << @resource_record_set
      @resource_record_set = {}
      @resource_record_set['ResourceRecords'] = []
    when 'ResourceRecordSets'
      @section = :main
    end
  elsif @section == :main
    case name
    when 'MaxItems'
      @response[name] = value.to_i
    when 'NextRecordName', 'NextRecordType', 'NextRecordIdentifier'
      @response[name] = value
    when 'IsTruncated'
      @response[name] = value == 'true'
    end
  end
end

- (Object) reset



6
7
8
9
10
11
12
13
14
15
# File 'lib/fog/aws/parsers/dns/list_resource_record_sets.rb', line 6

def reset
  @resource_record = []
  @resource_record_set = {}
  @resource_record_set['ResourceRecords'] = []
  @alias_target = {}
  @geo_location = {}
  @response = {}
  @response['ResourceRecordSets'] = []
  @section = :resource_record_set
end