Sha256: 379ccc6259884bbf9444f6cfabf9dc4742e1dc0b5ebd8ca8fff47c4db204a272

Contents?: true

Size: 633 Bytes

Versions: 61

Compression:

Stored size: 633 Bytes

Contents

module MobileWorkflow
  module ParamParser
    def mw_rewrite_payload_properties(model:, properties:)
      properties.each {|property| mw_rewrite_payload_property(model: model, model_property: property, params_property: property)}
    end

    def mw_rewrite_payload_property(model:, model_property:, params_property:)
      params[model][model_property] = params.dig(:payload, params_property, :answer)
    end

    def mw_rewrite_payload_array(model:, model_property:, params_property:)
      answer = params.dig(:payload, params_property, :answer)
      params[model][model_property] = answer[0] if answer
    end    
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
mobile_workflow-0.10.2 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.10.1 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.10.0 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.9.0 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.8.9 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.9 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.8 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.7 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.6 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.5 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.4 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.3 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.2 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.1 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.7.0 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.31 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.30 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.29 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.28 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.27 app/controllers/concerns/mobile_workflow/param_parser.rb