Class: Remap::Rule::Embed
- Inherits:
-
Unit
- Object
- Unit
- Remap::Rule::Embed
- Defined in:
- lib/remap/rule/embed.rb
Overview
Embed mappers into each other
Instance Method Summary collapse
-
#call(state, &error) ⇒ State<U>
Evaluates input against mapper and returns the result.
- #mapper ⇒ #call!
Instance Method Details
#call(state, &error) ⇒ State<U>
Evaluates input against mapper and returns the result
36 37 38 39 40 41 42 43 44 |
# File 'lib/remap/rule/embed.rb', line 36 def call(state, &error) unless error raise ArgumentError, "A block is required to evaluate the embed" end mapper.call!(state.set(mapper: mapper)) do |failure| return error[failure] end.except(:mapper, :scope) end |