Class: Swagger::Diff::Diff
- Inherits:
-
Object
- Object
- Swagger::Diff::Diff
- Defined in:
- lib/swagger/diff/diff.rb
Instance Method Summary collapse
- #compatible? ⇒ Boolean
- #incompatibilities ⇒ Object
- #incompatibilities_message ⇒ Object
-
#initialize(old, new) ⇒ Diff
constructor
A new instance of Diff.
Constructor Details
#initialize(old, new) ⇒ Diff
Returns a new instance of Diff.
4 5 6 7 |
# File 'lib/swagger/diff/diff.rb', line 4 def initialize(old, new) @new_specification = Swagger::Diff::Specification.new(new) @old_specification = Swagger::Diff::Specification.new(old) end |
Instance Method Details
#compatible? ⇒ Boolean
9 10 11 |
# File 'lib/swagger/diff/diff.rb', line 9 def compatible? endpoints_compatible? && requests_compatible? && responses_compatible? end |
#incompatibilities ⇒ Object
13 14 15 16 17 |
# File 'lib/swagger/diff/diff.rb', line 13 def incompatibilities { endpoints: missing_endpoints.to_a.sort, request_params: incompatible_request_params, response_attributes: incompatible_response_attributes } end |
#incompatibilities_message ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/swagger/diff/diff.rb', line 19 def msg = '' if incompatibilities[:endpoints] msg += (incompatibilities[:endpoints]) end if incompatibilities[:request_params] msg += (incompatibilities[:request_params]) end if incompatibilities[:response_attributes] msg += (incompatibilities[:response_attributes]) end msg end |