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.6.6 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.4 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.3 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.2 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.1 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.6.0 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.11 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.10 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.9 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.8 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.7 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.6 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.5 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.4 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.3 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.2 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.1 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.5.0 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.4.0 app/controllers/concerns/mobile_workflow/param_parser.rb
mobile_workflow-0.3.1 app/controllers/concerns/mobile_workflow/param_parser.rb