Class: GraphQL::SchemaComparator::Diff::Interface
- Inherits:
-
Object
- Object
- GraphQL::SchemaComparator::Diff::Interface
- Defined in:
- lib/graphql/schema_comparator/diff/interface.rb
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(old_interface, new_interface) ⇒ Interface
constructor
A new instance of Interface.
Constructor Details
#initialize(old_interface, new_interface) ⇒ Interface
Returns a new instance of Interface.
5 6 7 8 9 10 11 |
# File 'lib/graphql/schema_comparator/diff/interface.rb', line 5 def initialize(old_interface, new_interface) @old_interface = old_interface @new_interface = new_interface @old_fields = old_interface.fields @new_fields = new_interface.fields end |
Instance Method Details
#diff ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/graphql/schema_comparator/diff/interface.rb', line 13 def diff changes = [] changes += field_removals changes += field_additions each_common_field do |old_field, new_field| changes += Diff::Field.new(old_interface, new_interface, old_field, new_field).diff end changes end |