def _args_to_event(name_or_event, params={})
      raise ArgumentError, 'event parameters must be a hash' unless params.is_a?(Hash)

      case name_or_event
      when Event
        name_or_event.tap { |e| e.instance_variable_set(:@instance, self) }
      else
        Event.new(name_or_event, params.merge(instance: self))
      end
    end
def _args_to_event(name_or_event, params={})
      raise ArgumentError, 'event parameters must be a hash' unless params.is_a?(Hash)

      case name_or_event
      when Event
        name_or_event.tap { |e| e.instance_variable_set(:@instance, self) }
      else
        Event.new(name_or_event, params.merge(instance: self))
      end
    end
Attempt to convert *args to an event object.