class AWS::Core::XmlGrammar::Parser

@private

Public Class Methods

new(context, customizations) click to toggle source
# File lib/aws/core/xml_grammar.rb, line 464
def initialize context, customizations
  @context = context
  @customizations = customizations
end

Public Instance Methods

characters(chars) click to toggle source
# File lib/aws/core/xml_grammar.rb, line 496
def characters chars
  @frame.add_text(chars) if @frame
end
end_element(name) click to toggle source
# File lib/aws/core/xml_grammar.rb, line 486
def end_element name
  @frame.close
  if @frame.parent_frame
    child_frame = @frame
    parent_frame = @frame.parent_frame
    parent_frame.consume_child_frame(child_frame)
  end
  @frame = @frame.parent_frame
end
start_element(element_name, attrs) click to toggle source
# File lib/aws/core/xml_grammar.rb, line 469
def start_element element_name, attrs
  
  if @frame
    @frame = @frame.build_child_frame(element_name)
  else
    @frame = RootFrame.new(@context, @customizations)
  end
  
  # consume attributes the same way we consume nested xml elements
  attrs.each do |(attr_name, attr_value)|
    attr_frame = @frame.build_child_frame(attr_name)
    attr_frame.add_text(attr_value)
    @frame.consume_child_frame(attr_frame)
  end
  
end