Class: Openapi3Parser::Source::ResolvedReference
- Inherits:
-
Object
- Object
- Openapi3Parser::Source::ResolvedReference
- Extended by:
- Forwardable
- Defined in:
- lib/openapi3_parser/source/resolved_reference.rb
Instance Attribute Summary collapse
-
#object_type ⇒ Object
readonly
Returns the value of attribute object_type.
-
#source_location ⇒ Object
readonly
Returns the value of attribute source_location.
Instance Method Summary collapse
- #errors ⇒ Object
- #factory ⇒ Object
-
#initialize(source_location:, object_type:, reference_registry:) ⇒ ResolvedReference
constructor
A new instance of ResolvedReference.
- #valid? ⇒ Boolean
Constructor Details
#initialize(source_location:, object_type:, reference_registry:) ⇒ ResolvedReference
Returns a new instance of ResolvedReference.
15 16 17 18 19 20 21 |
# File 'lib/openapi3_parser/source/resolved_reference.rb', line 15 def initialize(source_location:, object_type:, reference_registry:) @source_location = source_location @object_type = object_type @reference_registry = reference_registry end |
Instance Attribute Details
#object_type ⇒ Object (readonly)
Returns the value of attribute object_type.
13 14 15 |
# File 'lib/openapi3_parser/source/resolved_reference.rb', line 13 def object_type @object_type end |
#source_location ⇒ Object (readonly)
Returns the value of attribute source_location.
13 14 15 |
# File 'lib/openapi3_parser/source/resolved_reference.rb', line 13 def source_location @source_location end |
Instance Method Details
#errors ⇒ Object
27 28 29 |
# File 'lib/openapi3_parser/source/resolved_reference.rb', line 27 def errors @errors ||= Array(build_errors) end |
#factory ⇒ Object
31 32 33 34 35 36 |
# File 'lib/openapi3_parser/source/resolved_reference.rb', line 31 def factory @factory ||= reference_registry.factory(object_type, source_location).tap do |factory| = "Unregistered node factory at #{source_location}" raise Openapi3Parser::Error, unless factory end end |
#valid? ⇒ Boolean
23 24 25 |
# File 'lib/openapi3_parser/source/resolved_reference.rb', line 23 def valid? errors.empty? end |