Class: Aws::Xml::Parser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/xml/parser.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(shape) ⇒ Parser

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Parser.



10
11
12
# File 'lib/aws-sdk-core/xml/parser.rb', line 10

def initialize(shape)
  @shape = shape
end

Instance Method Details

#parse(xml, target = nil) {|xml| ... } ⇒ Structure

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • xml (String<xml>)
  • target (Hash, nil) (defaults to: nil)

Yields:

  • (xml)

Returns:



17
18
19
20
21
# File 'lib/aws-sdk-core/xml/parser.rb', line 17

def parse(xml, target = nil, &block)
  xml = MultiXml.parse(xml).values.first || {}
  yield(xml) if block_given?
  structure(@shape, xml, target)
end