Class: RailsOpenapiGen::AstNodes::ArrayRootNode

Inherits:
ArrayNode show all
Defined in:
lib/rails-openapi-gen/ast_nodes.rb

Instance Attribute Summary

Attributes inherited from ArrayNode

#comment_data, #is_conditional, #is_root_array, #property_name

Attributes inherited from BaseNode

#children, #metadata, #parent

Instance Method Summary collapse

Methods inherited from ArrayNode

#accept, #add_item, #description, #item_type, #items, #optional?, #required?, #root_array?, #to_h

Methods inherited from BaseNode

#accept, #add_child, #debug_line, #descendants, #leaf?, #pretty_print, #remove_child, #root, #root?, #summary_attributes, #to_h

Constructor Details

#initialize(comment_data: nil, array_item_properties: []) ⇒ ArrayRootNode

Returns a new instance of ArrayRootNode.



111
112
113
114
# File 'lib/rails-openapi-gen/ast_nodes.rb', line 111

def initialize(comment_data: nil, array_item_properties: [])
  super(property_name: 'items', comment_data: comment_data, is_root_array: true)
  array_item_properties.each { |item| add_item(item) }
end

Instance Method Details

#add_item_property(property_node) ⇒ Object



124
125
126
# File 'lib/rails-openapi-gen/ast_nodes.rb', line 124

def add_item_property(property_node)
  add_item(property_node)
end

#array_item_propertiesObject



120
121
122
# File 'lib/rails-openapi-gen/ast_nodes.rb', line 120

def array_item_properties
  items
end

#propertyObject



116
117
118
# File 'lib/rails-openapi-gen/ast_nodes.rb', line 116

def property
  property_name
end