Class: Openapi3Parser::Source::Pointer::MergePointers
- Inherits:
-
Object
- Object
- Openapi3Parser::Source::Pointer::MergePointers
- Defined in:
- lib/openapi3_parser/source/pointer.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(base_pointer, new_pointer) ⇒ MergePointers
constructor
A new instance of MergePointers.
Constructor Details
#initialize(base_pointer, new_pointer) ⇒ MergePointers
Returns a new instance of MergePointers.
69 70 71 72 |
# File 'lib/openapi3_parser/source/pointer.rb', line 69 def initialize(base_pointer, new_pointer) @base_pointer = create_pointer(base_pointer) @new_pointer = create_pointer(new_pointer) end |
Class Method Details
.call(*args) ⇒ Object
65 66 67 |
# File 'lib/openapi3_parser/source/pointer.rb', line 65 def self.call(*args) new(*args).call end |
Instance Method Details
#call ⇒ Object
74 75 76 77 78 79 |
# File 'lib/openapi3_parser/source/pointer.rb', line 74 def call return base_pointer if new_pointer.nil? return new_pointer if base_pointer.nil? || new_pointer.absolute merge_pointers(base_pointer, new_pointer) end |