Skip to content

Multiple input properties #19

@iainbeeston

Description

@iainbeeston

I often find I have to use multiple input properties to get the value for aa single output property. Right now you can do this, but you have to use before filters, like this:

before_normalize do |input, output|
  input['ab'] ||= input['a'] + input['b']
  input
end

That feels inelegant. What if you could define mappings with multiple "from" properties, like this:

map from('/a', '/b'), to('ab') { |a, b| a + b }

Is that something that would be worth adding? I'm happy to put some work into a PR for that if you like the idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions