Class: Openapi3Parser::SourceInput::ResolveNext
- Inherits:
-
Object
- Object
- Openapi3Parser::SourceInput::ResolveNext
- Defined in:
- lib/openapi3_parser/source_input/resolve_next.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(reference, current_source_input, base_url, working_directory) ⇒ ResolveNext
constructor
A new instance of ResolveNext.
- #source_input ⇒ Object
Constructor Details
#initialize(reference, current_source_input, base_url, working_directory) ⇒ ResolveNext
Returns a new instance of ResolveNext.
19 20 21 22 23 24 25 26 27 |
# File 'lib/openapi3_parser/source_input/resolve_next.rb', line 19 def initialize(reference, current_source_input, base_url, working_directory) @reference = reference @current_source_input = current_source_input @base_url = base_url @working_directory = working_directory end |
Class Method Details
.call(reference, current_source_input, base_url: nil, working_directory: nil) ⇒ SourceInput
11 12 13 14 15 16 17 |
# File 'lib/openapi3_parser/source_input/resolve_next.rb', line 11 def self.call(reference, current_source_input, base_url: nil, working_directory: nil) new(reference, current_source_input, base_url, working_directory) .source_input end |
Instance Method Details
#source_input ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/openapi3_parser/source_input/resolve_next.rb', line 31 def source_input return current_source_input if reference.only_fragment? if reference.absolute? SourceInput::Url.new(reference.resource_uri) else base_url ? url_source_input : file_source_input end end |