Class: Assertion::Inverter
- Inherits:
-
Object
- Object
- Assertion::Inverter
- Defined in:
- lib/assertion/inverter.rb
Overview
Builds inversions for instances of some ‘Assertion::Base` subclass
Instance Attribute Summary collapse
-
#source ⇒ Class
readonly
The ‘Assertion::Base` sublcass to build negators for.
Class Method Summary collapse
-
.[](hash = {}) ⇒ Check::State
Initializes an assertion, builds its inversion, and applies it to the data.
- .initialize(source) ⇒ Object
-
.new(hash = {}) ⇒ Assertion::Inverter::Inversion
Initializes a [#source] object and builds a negator for it.
Instance Attribute Details
#source ⇒ Class (readonly)
Returns The ‘Assertion::Base` sublcass to build negators for.
24 25 26 |
# File 'lib/assertion/inverter.rb', line 24 def source @source end |
Class Method Details
.[](hash = {}) ⇒ Check::State
Initializes an assertion, builds its inversion, and applies it to the data
56 57 58 |
# File 'lib/assertion/inverter.rb', line 56 def [](hash = {}) new(hash).call end |
.initialize(source) ⇒ Object
35 36 37 38 |
# File 'lib/assertion/inverter.rb', line 35 def initialize(source) @source = source freeze end |
.new(hash = {}) ⇒ Assertion::Inverter::Inversion
Initializes a [#source] object and builds a negator for it
|
|
# File 'lib/assertion/inverter.rb', line 26
|