Class: Assertion::Inversion Private
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Describes the inversion of the assertion object
The inversion decorates the source assertion switching its message (from falsey to truthy) and reverting its ‘check`.
Class Attribute Summary collapse
-
.assertion ⇒ Assertion::Base
readonly
private
The assertion being inverted.
Attributes inherited from Base
Class Method Summary collapse
-
.check ⇒ Boolean
private
Checks the current state of the assertion.
- .initialize(assertion) ⇒ Object private
-
.message(state = nil) ⇒ String
private
The translated message describing the state of assertion.
-
.new(assertion) ⇒ Assertion::Inversion
Creates the inversion for the selected assertion object.
Methods inherited from Base
Methods included from DSL::Attributes
#attribute, #attributes, extended
Methods included from DSL::Inversion
Methods included from DSL::Caller
Class Attribute Details
.assertion ⇒ Assertion::Base (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The assertion being inverted.
42 43 44 |
# File 'lib/assertion/inversion.rb', line 42 def assertion @assertion end |
Class Method Details
.check ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks the current state of the assertion
58 59 60 |
# File 'lib/assertion/inversion.rb', line 58 def check !assertion.check end |
.initialize(assertion) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 |
# File 'lib/assertion/inversion.rb', line 33 def initialize(assertion) @assertion = assertion IceNine.deep_freeze(self) end |
.message(state = nil) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The translated message describing the state of assertion
50 51 52 |
# File 'lib/assertion/inversion.rb', line 50 def (state = nil) assertion. !state end |
.new(assertion) ⇒ Assertion::Inversion
Creates the inversion for the selected assertion object
|
# File 'lib/assertion/inversion.rb', line 24
|