lib/rundock/hook_factory.rb in rundock-0.5.4 vs lib/rundock/hook_factory.rb in rundock-0.5.7

- old
+ new

@@ -15,14 +15,14 @@ Logger.debug("initialize #{klass} hook") raise HookNotImplementedError unless Rundock::Hook::Base.subclasses.map(&:to_s).include?(klass) obj = nil klass.split('::').map do |k| - if obj.nil? - obj = Kernel.const_get(k) - else - obj = obj.const_get(k) - end + obj = if obj.nil? + Kernel.const_get(k) + else + obj = obj.const_get(k) + end end hook = obj.new(name, attributes) hook end