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

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/xml/parser/stack.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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref, result = nil) ⇒ 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.



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

def initialize(ref, result = nil)
  @ref = ref
  @frame = self
  @result = result
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.



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

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.



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

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.



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

def attr(name, value)
  if name.to_s == 'encoding' && value.to_s == 'base64'
    @frame = BlobFrame.new(@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.



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

def child_frame(name)
  Frame.new(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.



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

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.



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

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:



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

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.



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

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.



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

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