Class: CheckPlease::Diff
- Inherits:
-
Object
- Object
- CheckPlease::Diff
- Defined in:
- lib/check_please/diff.rb
Constant Summary collapse
- COLUMNS =
%i[ type path reference candidate ]
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(type, path, reference, candidate) ⇒ Diff
constructor
A new instance of Diff.
- #inspect ⇒ Object
Constructor Details
#initialize(type, path, reference, candidate) ⇒ Diff
Returns a new instance of Diff.
7 8 9 10 11 12 |
# File 'lib/check_please/diff.rb', line 7 def initialize(type, path, reference, candidate) @type = type @path = path.to_s @reference = reference @candidate = candidate end |
Instance Method Details
#attributes ⇒ Object
14 15 16 |
# File 'lib/check_please/diff.rb', line 14 def attributes Hash[ COLUMNS.map { |name| [ name, send(name) ] } ] end |
#inspect ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/check_please/diff.rb', line 18 def inspect s = "<" s << self.class.name s << " type=#{type}" s << " path=#{path}" s << " ref=#{reference.inspect}" s << " can=#{candidate.inspect}" s << ">" s end |