class Reactor::Plans::UpdateObj

Public Class Methods

new(opts={}) click to toggle source
# File lib/reactor/plans/update_obj.rb, line 6
def initialize(opts={})
  @key = opts[:obj_id] || opts[:path]
  @attrs = {}
end

Public Instance Methods

migrate!() click to toggle source
# File lib/reactor/plans/update_obj.rb, line 20
def migrate!
  obj = Reactor::Cm::Obj.get(@key)
  @attrs.each do |key,value|
    @obj.set(key,value)
  end
  @obj.save!
  @obj.release!
end
prepare!() click to toggle source
# File lib/reactor/plans/update_obj.rb, line 15
def prepare!
  error("object (key=#{@key}) not found") if not Reactor::Cm::Obj.exists?(@key)
  #TODO: attribute check
end
set(key, value) click to toggle source
# File lib/reactor/plans/update_obj.rb, line 11
def set(key, value)
  @attrs[key.to_sym] = value
end