Module: OpenAPIParser::Parser::Object

Included in:
Core
Defined in:
lib/openapi_parser/concerns/parser/object.rb

Instance Method Summary collapse

Instance Method Details

#_openapi_attr_objectsObject



2
3
4
# File 'lib/openapi_parser/concerns/parser/object.rb', line 2

def _openapi_attr_objects
  @_openapi_attr_objects ||= {}
end

#openapi_attr_object(name, klass, options = {}) ⇒ Object



10
11
12
13
# File 'lib/openapi_parser/concerns/parser/object.rb', line 10

def openapi_attr_object(name, klass, options = {})
  target_klass.send(:attr_reader, name)
  _openapi_attr_objects[name] = OpenAPIParser::SchemaLoader::ObjectsLoader.new(name, options.merge(klass: klass))
end

#openapi_attr_objects(*names, klass) ⇒ Object



6
7
8
# File 'lib/openapi_parser/concerns/parser/object.rb', line 6

def openapi_attr_objects(*names, klass)
  names.each { |name| openapi_attr_object(name, klass) }
end