Class: CaDOVe::Reports::ClassReport

Inherits:
Object
  • Object
show all
Defined in:
lib/cadove/models/reports/reports.rb

Instance Method Summary collapse

Constructor Details

#initialize(comparison, left_type, right_type) ⇒ ClassReport

Returns a new instance of ClassReport.



5
6
7
8
9
# File 'lib/cadove/models/reports/reports.rb', line 5

def initialize(comparison, left_type, right_type)
  @comparison = comparison
  @left_type = left_type
  @right_type = right_type
end

Instance Method Details

#displayObject



11
12
13
14
15
16
17
18
19
# File 'lib/cadove/models/reports/reports.rb', line 11

def display
  puts Time.new.strftime('%b %d, %Y %H:%M:%S %Z')
  puts "\n"
  puts "  #{header(@left_type)}   |   #{header(@right_type)}  | Class Name"
  puts "--------------------------------"
  @comparison.classes.each do |clazz|
    puts "   #{clazz.left_match? ? 'X' : ' '}    |    #{clazz.right_match? ? 'X' : ' '}    | #{clazz.key.display}"
  end
end

#header(name) ⇒ Object



21
22
23
# File 'lib/cadove/models/reports/reports.rb', line 21

def header(name)
  name.to_s.upcase
end