Class: Pact::Matchers::BaseDifference
- Inherits:
-
Object
- Object
- Pact::Matchers::BaseDifference
show all
- Defined in:
- lib/pact/matchers/base_difference.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(expected, actual, message = nil) ⇒ BaseDifference
Returns a new instance of BaseDifference.
11
12
13
14
15
|
# File 'lib/pact/matchers/base_difference.rb', line 11
def initialize expected, actual, message = nil
@expected = expected
@actual = actual
@message = message
end
|
Instance Attribute Details
#actual ⇒ Object
Returns the value of attribute actual.
8
9
10
|
# File 'lib/pact/matchers/base_difference.rb', line 8
def actual
@actual
end
|
#expected ⇒ Object
Returns the value of attribute expected.
8
9
10
|
# File 'lib/pact/matchers/base_difference.rb', line 8
def expected
@expected
end
|
#message ⇒ Object
Returns the value of attribute message.
8
9
10
|
# File 'lib/pact/matchers/base_difference.rb', line 8
def message
@message
end
|
Instance Method Details
#==(other) ⇒ Object
33
34
35
|
# File 'lib/pact/matchers/base_difference.rb', line 33
def == other
other.class == self.class && other.expected == expected && other.actual == actual
end
|
#any? ⇒ Boolean
17
18
19
|
# File 'lib/pact/matchers/base_difference.rb', line 17
def any?
true
end
|
#empty? ⇒ Boolean
21
22
23
|
# File 'lib/pact/matchers/base_difference.rb', line 21
def empty?
false
end
|
#to_json(options = {}) ⇒ Object
25
26
27
|
# File 'lib/pact/matchers/base_difference.rb', line 25
def to_json options = {}
as_json.to_json(options)
end
|
#to_s ⇒ Object
29
30
31
|
# File 'lib/pact/matchers/base_difference.rb', line 29
def to_s
as_json.to_s
end
|