Sha256: 24dc439934c77b5941877eef141fc1d33627f97700503c1289b387f4379218c0

Contents?: true

Size: 416 Bytes

Versions: 3

Compression:

Stored size: 416 Bytes

Contents

require 'reactor/plans/prepared'

module Reactor
  module Plans
    class DeleteObj
      include Prepared

      def initialize(opts={})
        @key = opts[:obj_id] || opts[:path]
      end

      def prepare!
        error("object (key=#{@key}) not found") if not Reactor::Cm::Obj.exists?(@key)
      end

      def migrate!
        obj = Reactor::Cm::Obj.get(@key)
        obj.delete!
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
infopark_reactor_migrations-1.6.1 lib/reactor/plans/delete_obj.rb
infopark_reactor_migrations-1.5.2 lib/reactor/plans/delete_obj.rb
infopark_reactor_migrations-1.5.1 lib/reactor/plans/delete_obj.rb