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


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

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.


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

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.


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

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:


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

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.


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

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.


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

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