Class: Inch::API::Compare::Codebases
- Inherits:
-
Object
- Object
- Inch::API::Compare::Codebases
- Defined in:
- lib/inch/api/compare/codebases.rb
Instance Method Summary collapse
- #added_objects ⇒ Object
- #comparisons ⇒ Object
- #degraded_objects ⇒ Object
- #find(fullname) ⇒ Object
- #improved_objects ⇒ Object
-
#initialize(codebase1, codebase2) ⇒ Codebases
constructor
A new instance of Codebases.
- #removed_objects ⇒ Object
Constructor Details
#initialize(codebase1, codebase2) ⇒ Codebases
Returns a new instance of Codebases.
5 6 7 |
# File 'lib/inch/api/compare/codebases.rb', line 5 def initialize(codebase1, codebase2) @a, @b = codebase1, codebase2 end |
Instance Method Details
#added_objects ⇒ Object
9 10 11 |
# File 'lib/inch/api/compare/codebases.rb', line 9 def added_objects comparisons.select(&:added?) end |
#comparisons ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/inch/api/compare/codebases.rb', line 25 def comparisons __objects_names.map do |fullname| object1 = @a.objects.find(fullname) object2 = @b.objects.find(fullname) Compare::CodeObjects.new(object1, object2) end end |
#degraded_objects ⇒ Object
17 18 19 |
# File 'lib/inch/api/compare/codebases.rb', line 17 def degraded_objects comparisons.select(&:degraded?) end |
#find(fullname) ⇒ Object
33 34 35 36 37 |
# File 'lib/inch/api/compare/codebases.rb', line 33 def find(fullname) comparisons.detect do |comparison| comparison.fullname == fullname end end |
#improved_objects ⇒ Object
13 14 15 |
# File 'lib/inch/api/compare/codebases.rb', line 13 def improved_objects comparisons.select(&:improved?) end |
#removed_objects ⇒ Object
21 22 23 |
# File 'lib/inch/api/compare/codebases.rb', line 21 def removed_objects comparisons.select(&:removed?) end |