Module: GrapeOAS::Introspectors::Base
- Included in:
- DryIntrospector, EntityIntrospector
- Defined in:
- lib/grape_oas/introspectors/base.rb
Overview
Base module that defines the interface for all introspectors. Any introspector (built-in or third-party) must implement these class methods.
Instance Method Summary collapse
-
#build_schema(subject, stack: [], registry: {}) ⇒ ApiModel::Schema?
Builds a schema from the given subject.
-
#handles?(subject) ⇒ Boolean
Checks if this introspector can handle the given subject.
Instance Method Details
#build_schema(subject, stack: [], registry: {}) ⇒ ApiModel::Schema?
Builds a schema from the given subject.
39 40 41 |
# File 'lib/grape_oas/introspectors/base.rb', line 39 def build_schema(subject, stack: [], registry: {}) raise NotImplementedError, "#{self} must implement .build_schema(subject, stack:, registry:)" end |
#handles?(subject) ⇒ Boolean
Checks if this introspector can handle the given subject.
29 30 31 |
# File 'lib/grape_oas/introspectors/base.rb', line 29 def handles?(subject) raise NotImplementedError, "#{self} must implement .handles?(subject)" end |