Class: Openapi3Parser::SourceInput::Url::RelativeUrlDifference
- Inherits:
-
Object
- Object
- Openapi3Parser::SourceInput::Url::RelativeUrlDifference
- Defined in:
- lib/openapi3_parser/source_input/url.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(from_url, to_url) ⇒ RelativeUrlDifference
constructor
A new instance of RelativeUrlDifference.
Constructor Details
#initialize(from_url, to_url) ⇒ RelativeUrlDifference
Returns a new instance of RelativeUrlDifference.
84 85 86 87 |
# File 'lib/openapi3_parser/source_input/url.rb', line 84 def initialize(from_url, to_url) @from_uri = URI.parse(from_url) @to_uri = URI.parse(to_url) end |
Class Method Details
.call(from_url, to_url) ⇒ Object
89 90 91 |
# File 'lib/openapi3_parser/source_input/url.rb', line 89 def self.call(from_url, to_url) new(from_url, to_url).call end |
Instance Method Details
#call ⇒ Object
93 94 95 96 |
# File 'lib/openapi3_parser/source_input/url.rb', line 93 def call return to_uri.to_s if different_hosts? relative_path end |