class Fog::Parsers::Schema::NodeStack
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/ext_fog_aws/fog/parsers/schema.rb, line 29 def initialize(*args) @response, @schema, @arrays = args super() end
Public Instance Methods
end_element(name, value)
click to toggle source
# File lib/ext_fog_aws/fog/parsers/schema.rb, line 46 def end_element(name, value) if top if (@arrays + [top.name]).include? name top.update_result(value) pop end end end
new_node(name, schema_pointer, result_pointer)
click to toggle source
# File lib/ext_fog_aws/fog/parsers/schema.rb, line 55 def new_node(name, schema_pointer, result_pointer) node_class = case schema_pointer[name] when Hash NodeHash when Array NodeArray else NodeValue end node_class.new(name, schema_pointer, result_pointer) end
start_element(name)
click to toggle source
# File lib/ext_fog_aws/fog/parsers/schema.rb, line 34 def start_element(name) if top if @arrays.include? name push top.new_item elsif top.next_schema.key? name push new_node(name, top.next_schema, top.next_result) end elsif @schema.key? name push new_node(name, @schema, @response) end end