require 'fiona7/builder/obj_updater' require 'fiona7/builder/widget_building' module Fiona7 module Builder class WidgetUpdater < ObjUpdater include WidgetBuilding def initialize(owner_obj, widget_id, values, path_map) @owner_obj, @widget_id, @values, @widget_path_map = owner_obj, widget_id, values.symbolize_keys, path_map end protected def update? true end def prepare_object @path = self.generate_widget_path @obj = WriteObj.find(@values.delete(:_id)) @name = @widget_id if obj_class = @values.delete(:_obj_class) @obj_class = obj_class @real_obj_class = Fiona7::ObjClassNameMangler.new(@obj_class).mangle else @real_obj_class = @obj.obj_class @obj_class = Fiona7::ObjClassNameDemangler.new(@real_obj_class).demangle end ensure_obj_class_exists end end end end