Class: Lookout::Difference::Symbol

Inherits:
Object show all
Defined in:
lib/lookout-3.0/difference/symbol.rb

Overview

Difference reports between Symbols.

Instance Attribute Summary

Attributes inherited from Object

#actual, #expected

Instance Method Summary collapse

Methods inherited from Object

#==, #diff, #hash, #to_s

Constructor Details

#initialize(actual, expected, query, negated) ⇒ Symbol

Initializes a difference report between the ACTUAL result Symbol and the EXPECTED value Symbol, with QUERY being the name of the query method that EXPECTED represents, if any, whose result may be NEGATED.

Parameters:



11
12
13
14
# File 'lib/lookout-3.0/difference/symbol.rb', line 11

def initialize(actual, expected, query, negated)
  super actual, expected
  @query, @negated = query, negated
end

Instance Method Details

#message::String, super

Returns A String of the form Object#actual#QUERY, prefixed by ‘¬’ if the query was negated, if there was a query, super otherwise.

Returns:

  • (::String, super)

    A String of the form Object#actual#QUERY, prefixed by ‘¬’ if the query was negated, if there was a query, super otherwise



18
19
20
# File 'lib/lookout-3.0/difference/symbol.rb', line 18

def message
  @query ? [@negated ? '' : '¬', inspect_actual, '#', @query].join('') : super
end