Class: Aws::Xml::Parser::Stack Private

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

Overview

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.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref, result = nil, &unhandled_callback) ⇒ Stack

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 Stack.

API:

  • private



6
7
8
9
10
11
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 6

def initialize(ref, result = nil, &unhandled_callback)
  @ref = ref
  @frame = self
  @result = result
  @unhandled_callback = unhandled_callback
end

Instance Attribute Details

#frameObject (readonly)

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.

API:

  • private



13
14
15
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 13

def frame
  @frame
end

#resultObject (readonly)

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.

API:

  • private



15
16
17
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 15

def result
  @result
end

Instance Method Details

#attr(name, value) ⇒ Object

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.

API:

  • private



21
22
23
24
25
26
27
28
29
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 21

def attr(name, value)
  if name.to_s == 'encoding' && value.to_s == 'base64'
    @frame = BlobFrame.new(name, @frame.parent, @frame.ref)
  else
    start_element(name)
    text(value)
    end_element(name)
  end
end

#child_frame(name) ⇒ Object

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.

API:

  • private



48
49
50
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 48

def child_frame(name)
  Frame.new(name, self, @ref, @result)
end

#consume_child_frame(frame) ⇒ Object

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.

API:

  • private



52
53
54
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 52

def consume_child_frame(frame)
  @result = frame.result
end

#end_element(*args) ⇒ Object

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.

API:

  • private



35
36
37
38
39
40
41
42
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 35

def end_element(*args)
  @frame.parent.consume_child_frame(@frame)
  if @frame.parent.is_a?(FlatListFrame)
    @frame = @frame.parent
    @frame.parent.consume_child_frame(@frame)
  end
  @frame = @frame.parent
end

#error(msg, line = nil, column = nil) ⇒ Object

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.

Raises:

API:

  • private



44
45
46
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 44

def error(msg, line = nil, column = nil)
  raise ParsingError.new(msg, line, column)
end

#start_element(name) ⇒ Object

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.

API:

  • private



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

def start_element(name)
  @frame = @frame.child_frame(name.to_s)
end

#text(value) ⇒ Object

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.

API:

  • private



31
32
33
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 31

def text(value)
  @frame.set_text(value)
end

#yield_unhandled_value(path, value) ⇒ Object

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.

API:

  • private



57
58
59
60
61
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 57

def yield_unhandled_value(path, value)
  if @unhandled_callback
    @unhandled_callback.call(path, value)
  end
end