class Reactor::Plans::RenameGroup

Public Class Methods

new(*args) click to toggle source
# File lib/reactor/plans/rename_group.rb, line 9
def initialize(*args)
  (from, to), options = separate_arguments(*args)

  @from = from || options[:from]
  @to = to || options[:to]
end

Public Instance Methods

migrate!() click to toggle source
# File lib/reactor/plans/rename_group.rb, line 23
def migrate!
  group = Reactor::Cm::Group.get(@from)
  group.rename!(@to)
end
prepare!() click to toggle source
# File lib/reactor/plans/rename_group.rb, line 16
def prepare!
  error('from is nil') if @from.nil?
  error('to is nil') if @to.nil?
  error('from does not exist') unless Reactor::Cm::Group.exists?(@from)
  error('to does exist') if Reactor::Cm::Group.exists?(@to)
end