Class: Morpher::Transform::Hash::Key

Inherits:
Morpher::Transform show all
Defined in:
lib/morpher/transform.rb

Overview

Key specific transformation

Instance Method Summary collapse

Methods inherited from Morpher::Transform

#array, #maybe, #seq, #to_proc

Instance Method Details

#call(input) ⇒ Either<Error, Object>

Apply transformation to input

Parameters:

  • (Object)

Returns:



351
352
353
354
355
# File 'lib/morpher/transform.rb', line 351

def call(input)
  transform.call(input).lmap do |error|
    error(cause: error, input: input)
  end
end

#slugString

Rendering slug

Returns:

  • (String)


341
342
343
# File 'lib/morpher/transform.rb', line 341

def slug
  '[%<key>s]' % { key: value.inspect }
end