Class: Fog::Parsers::Schema::NodeArray

Inherits:
Node
  • Object
show all
Defined in:
lib/ext_fog_aws/fog/parsers/schema.rb

Instance Attribute Summary

Attributes inherited from Node

#name

Instance Method Summary collapse

Methods inherited from Node

#next_result, #update_result

Constructor Details

#initializeNodeArray

Returns a new instance of NodeArray.



163
164
165
166
167
# File 'lib/ext_fog_aws/fog/parsers/schema.rb', line 163

def initialize(*)
  super
  @count = 0
  @result_pointer[name] = []
end

Instance Method Details

#new_itemObject



173
174
175
176
177
178
# File 'lib/ext_fog_aws/fog/parsers/schema.rb', line 173

def new_item
  index = @count
  @count += 1
  item_class = next_schema.is_a?(Hash) ? NodeHash : NodeValue
  item_class.new(name, @schema_pointer, @result_pointer, index)
end

#next_schemaObject



169
170
171
# File 'lib/ext_fog_aws/fog/parsers/schema.rb', line 169

def next_schema
  @schema_pointer[name].first
end