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

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

Overview

Key specific transformation

Instance Method Summary collapse

Instance Method Details

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

Apply transformation to input

Parameters:

  • (Object)

Returns:



321
322
323
324
325
# File 'lib/morpher/transform.rb', line 321

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

#slugString

Rendering slug

Returns:

  • (String)


311
312
313
# File 'lib/morpher/transform.rb', line 311

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