Class: GraphQL::SchemaComparator::Result
- Inherits:
-
Object
- Object
- GraphQL::SchemaComparator::Result
- Defined in:
- lib/graphql/schema_comparator/result.rb
Instance Attribute Summary collapse
-
#breaking_changes ⇒ Object
readonly
Returns the value of attribute breaking_changes.
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#non_breaking_changes ⇒ Object
readonly
Returns the value of attribute non_breaking_changes.
Instance Method Summary collapse
- #breaking? ⇒ Boolean
- #identical? ⇒ Boolean
-
#initialize(changes) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(changes) ⇒ Result
Returns a new instance of Result.
6 7 8 9 |
# File 'lib/graphql/schema_comparator/result.rb', line 6 def initialize(changes) @changes = changes.sort_by { |c| [c.breaking ? 1 : 2, c.] } @breaking_changes, @non_breaking_changes = @changes.partition(&:breaking) end |
Instance Attribute Details
#breaking_changes ⇒ Object (readonly)
Returns the value of attribute breaking_changes.
4 5 6 |
# File 'lib/graphql/schema_comparator/result.rb', line 4 def breaking_changes @breaking_changes end |
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
4 5 6 |
# File 'lib/graphql/schema_comparator/result.rb', line 4 def changes @changes end |
#non_breaking_changes ⇒ Object (readonly)
Returns the value of attribute non_breaking_changes.
4 5 6 |
# File 'lib/graphql/schema_comparator/result.rb', line 4 def non_breaking_changes @non_breaking_changes end |
Instance Method Details
#breaking? ⇒ Boolean
15 16 17 |
# File 'lib/graphql/schema_comparator/result.rb', line 15 def breaking? breaking_changes.any? end |
#identical? ⇒ Boolean
11 12 13 |
# File 'lib/graphql/schema_comparator/result.rb', line 11 def identical? @changes.empty? end |