Class: GraphQL::SchemaComparator::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/schema_comparator/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.message] }
  @breaking_changes, @non_breaking_changes = @changes.partition(&:breaking)
end

Instance Attribute Details

#breaking_changesObject (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

#changesObject (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_changesObject (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

Returns:

  • (Boolean)


15
16
17
# File 'lib/graphql/schema_comparator/result.rb', line 15

def breaking?
  breaking_changes.any?
end

#identical?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/graphql/schema_comparator/result.rb', line 11

def identical?
  @changes.empty?
end