Sha256: f8967d3222fc99cec3e46a52b1c77132ddef73cdbd1170122ff06a9a19f406a6

Contents?: true

Size: 1.12 KB

Versions: 21

Compression:

Stored size: 1.12 KB

Contents

require 'fiona7/builder/obj_builder'
#require 'fiona7/write_obj'

module Fiona7
  module Builder
    class ObjUpdater < ObjBuilder
      protected
      def update?
        true
      end

      def validate
        return true
      end

      def prepare_object
        obj_id       = @values.delete(:_id)
        @obj         = WriteObj.find(obj_id)
        @path        = @values.delete(:_path)
        @widget_pool = @values.delete(:_widget_pool)
        @permalink   = @values.delete(:_permalink)

        # revert command sends this info. which is silly.
        @values.delete(:_last_changed)

        @name, parent_path = name_and_parent_path_from_path(@path) if (@path)
        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

        @obj.name = @name unless @name.blank?
        # TODO: move (parent change)
      end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
infopark_fiona7-1.2.0.2.3 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.2.1 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.2.2 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.1.4 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.1.3 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.5.2.1.0.pre.beta1 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.5.2.0.0 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.1.1 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.0.1 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.2.0.0.0 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.9 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.8 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.7 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.6 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.5 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.4 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.3 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.2 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.10 lib/fiona7/builder/obj_updater.rb
infopark_fiona7-1.1.0.0.1 lib/fiona7/builder/obj_updater.rb