Class: OpenAPIParser::Schemas::PathItem

Inherits:
Base
  • Object
show all
Defined in:
lib/openapi_parser/schemas/classes.rb,
lib/openapi_parser/schemas/path_item.rb

Instance Attribute Summary

Attributes inherited from Base

#object_reference, #parent, #raw_schema, #root

Instance Method Summary collapse

Methods inherited from Base

#after_init, #initialize, #inspect

Methods included from Expandable

#expand_reference

Methods included from Findable

#find_object, #purge_object_cache

Methods included from Parser

#_openapi_all_child_objects, #_update_child_object, included, #load_data

Constructor Details

This class inherits a constructor from OpenAPIParser::Schemas::Base

Instance Method Details

#operation(method) ⇒ Operation

Returns:



12
13
14
15
16
# File 'lib/openapi_parser/schemas/path_item.rb', line 12

def operation(method)
  public_send(method)
rescue NoMethodError
  nil
end

#set_path_item_to_operationObject



18
19
20
# File 'lib/openapi_parser/schemas/path_item.rb', line 18

def set_path_item_to_operation
  [:get, :put, :post, :delete, :options, :head, :patch, :trace].each{ |method| operation(method)&.set_parent_path_item(self)}
end