Module: Minfraud::Resolver
- Included in:
- Assessments
- Defined in:
- lib/minfraud/resolver.rb
Overview
Resolver provides functionality for setting component attributes.
Class Method Summary collapse
-
.assign(context, params) ⇒ Array
Set keys on the context based on the provided parameters.
Class Method Details
.assign(context, params) ⇒ Array
Set keys on the context based on the provided parameters.
16 17 18 19 20 21 22 23 |
# File 'lib/minfraud/resolver.rb', line 16 def assign(context, params) Array(params).each do |key, value| raise RequestFormatError, "#{key} does not belong to request document format" unless MAPPING[key] entity = MAPPING[key].new(value) unless value.is_a?(MAPPING[key]) context.send("#{key}=", entity || value) end end |