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, &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.



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

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.



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

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.



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

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.



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 23

def attr(name, value)
  if name.to_s == 'encoding' && value.to_s == 'base64'
    @frame = BlobFrame.new(name, @frame.parent, @frame.ref)
  else
    # don't try to parse shapes from xml namespace
    return if name.to_s == 'xmlns'
    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.



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

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.



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

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.



39
40
41
42
43
44
45
46
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 39

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:



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

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.



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

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.



35
36
37
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 35

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.



61
62
63
64
65
# File 'lib/aws-sdk-core/xml/parser/stack.rb', line 61

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