Sha256: 2749686f797c51bfdd76da05c342ad4ac7cd2a99659abadf6b674a44eb8a0a86

Contents?: true

Size: 700 Bytes

Versions: 3

Compression:

Stored size: 700 Bytes

Contents

module Scrivito
  class ObjUpdateParamsParser < Struct.new(:obj, :host, :port)
    include ObjParamsParser

    private

    def convert_params(params)
      convert_field_params(params, obj.attribute_definitions)
      convert_widget_pool_params(params)
    end

    def convert_widget_pool_params(params)
      return unless params['_widget_pool']

      widget_pool = {}
      params['_widget_pool'].each_pair do |widget_id, widget_params|
        if widget_params.present?
          widget = obj.widgets[widget_id]
          widget_pool[widget] = convert_field_params(widget_params, widget.attribute_definitions)
        end
      end
      params['_widget_pool'] = widget_pool
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scrivito_sdk-0.60.0 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.60.0.rc2 lib/scrivito/obj_update_params_parser.rb
scrivito_sdk-0.60.0.rc1 lib/scrivito/obj_update_params_parser.rb