You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::Core::XML::RootFrame

Inherits:
Frame
  • Object
show all
Defined in:
lib/aws/core/xml/root_frame.rb

Constant Summary

Constant Summary

Constants inherited from Frame

Frame::DATE_PUNCTUATION, Frame::EASY_FORMAT, Frame::TRANSLATE_DIGITS

Instance Attribute Summary

Attributes inherited from Frame

#element_name, #parent_frame, #root_frame, #rules

Instance Method Summary collapse

Methods inherited from Frame

#add_text, #close, #consume_child_frame, #data, #forced?, #ignored?, #index_keys_for, #keys_from_path, #known_child_frames, #list?, #map?, #ruby_name, #rules_for, #wrapped?

Constructor Details

#initialize(rules) ⇒ RootFrame

Returns a new instance of RootFrame



20
21
22
23
24
25
# File 'lib/aws/core/xml/root_frame.rb', line 20

def initialize rules
  @inflected = {}
  @indexes = {}
  setup_indexes(rules)
  super(self, nil, 'XML', rules)
end

Instance Method Details

#add_to_index(index_name, key, value) ⇒ Object



37
38
39
40
# File 'lib/aws/core/xml/root_frame.rb', line 37

def add_to_index index_name, key, value
  @indexes[index_name] ||= {}
  @indexes[index_name][key] = value
end

#build_child_frame(element_name) ⇒ Object



27
28
29
# File 'lib/aws/core/xml/root_frame.rb', line 27

def build_child_frame element_name
  Frame.new(self, self, element_name, rules)
end

#inflect(element_name) ⇒ Object

The root frame maintains a cache of inflected element names.



43
44
45
# File 'lib/aws/core/xml/root_frame.rb', line 43

def inflect element_name
  @inflected[element_name] ||= Inflection.ruby_name(element_name).to_sym
end

#valueObject



31
32
33
34
35
# File 'lib/aws/core/xml/root_frame.rb', line 31

def value
  value = @data.values.find{|v| v.is_a?(Hash) }
  value ||= {}
  value.merge(@indexes)
end