Sha256: dddecae2e1b041bf2b027dbf5543608f2b8189d9781cc3dd7334b68a3874993a

Contents?: true

Size: 973 Bytes

Versions: 32

Compression:

Stored size: 973 Bytes

Contents

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
infopark_fiona7-1.2.0.0.0 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.9 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.8 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.7 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.6 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.5 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.4 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.3 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.2 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.10 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.1 lib/fiona7/builder/widget_updater.rb
infopark_fiona7-1.1.0.0.0 lib/fiona7/builder/widget_updater.rb