Method: Dry::Transformer::Conditional.not

Defined in:
lib/dry/transformer/conditional.rb

.not(value, fn) ⇒ Boolean

Negates the result of transformation

Examples:

fn = Conditional[:not, -> value { value.is_a? ::String }]
fn[:foo]  # => true
fn["foo"] # => false

Parameters:

  • value (Object)
  • fn (Proc)

Returns:

  • (Boolean)


34
35
36
# File 'lib/dry/transformer/conditional.rb', line 34

def self.not(value, fn)
  !fn[value]
end