Raise error when the method is already defined

 @example
   detect_event_conflict!(:test, "test=")

 @raise [FiniteMachine::AlreadyDefinedError]

 @return [nil]

 @api public
424160
def detect_event_conflict!(event_name, method_name = event_name)
      if method_already_implemented?(method_name)
        raise FiniteMachine::AlreadyDefinedError, EVENT_CONFLICT_MESSAGE % {
          name: event_name,
          type: :instance,
          method: method_name,
          source: 'FiniteMachine'
        }
      end
    end
34721
def deflect_start(from, id, deflector)
      @@sync.synchronize do
        Deflect.deflecting ||= DeflectorCollection.new
        Deflect.deflecting.member?(from, id) and
          raise DeflectError, "#{from}##{id} is already deflected"
        Deflect.deflecting.add(from, id, deflector)
        from.class_eval do
          define_method(id) do |*args|
            if Deflect.deflecting and d = Deflect.deflecting.find(self.class, id)
              d.call(self, id, *args)
            else
              super(*args)
            end
          end
        end
      end
    end
597262
def method_missing(*args, &block)
      if Namespace.exists?(args.first)
        create_namespace(args.first)
      else
        call_method(args, &block)
      end
    end
1288700
def assert_defined(&block)
      value = nil
      begin
        value = yield
      rescue NameError => e
        raise ArgumentError, udef_msg(e, block)
      end
      value
    end
585010
def method_missing(method, *args, &block) # :nodoc:
      case method.to_s
      when /^(.*)\?$/
        return !self.send($1.to_s).nil?
      when /^clear_(.*)$/
        self.send("#{$1.to_s}=", nil)
      else
        super
      end
    end
169390
def method_missing(method_name, *arguments)
      klass = REGISTRY.fetch(method_name) { super }

      Evaluator.new(klass, arguments).rules.each do |rule|
        add(rule)
      end

      self
    end
1093548
public B error() {
    ErrorEventDefinition errorEventDefinition = createInstance(ErrorEventDefinition.class);
    element.getEventDefinitions().add(errorEventDefinition);

    return myself;
  }
1345539
def method_missing(method_name, *arguments, &block)
      ivar = "@#{method_name.to_s.gsub('=', '')}"
      ivar_sym = ":#{ivar}"
      if method_name[-1] == '?'
        return id == method_name[0..-2].to_sym
      elsif method_name[-1] == '='
        define_singleton_method(method_name) do |val|
          instance_variable_set(ivar, val)
        end
      elsif instance_variables.include? ivar_sym
        instance_variable_get(ivar)
      else
        define_singleton_method(method_name) do
          instance_variable_get(ivar)
        end
      end
      send(method_name, *arguments, &block)
    end
360659
def method_missing(meth, *args, &block)
      if !loaded?
        self.loaded = true
        reload
        send(meth, *args, &block)
      else
        super
      end
    end
50799
def try(*method_chain)
      obj = self.element
      method_chain.each do |m|
        # We'll break out and return nil if any part of the chain
        # doesn't respond properly.
        (obj = nil) && break unless obj.respond_to?(m)
        obj = obj.send(m)
      end
      obj
    end
561832
def method_missing(key, *args, &block)
      if key.to_s =~ /\A(.+)=\z/
        self[$1] = args.first
        return args.first
      end
      if key.to_s =~ /\A(.+)\?\z/
        return !!self[$1]
      end
      return self[key]  if has_key?(key)
      nil
    end
763039
def method_missing(method, *args, &block)
      super
    rescue NoMethodError
      return regs(method) if self.has_reg?(method)
      return ports(method) if self.has_port?(method)
      if method.to_s =~ /=$/
        define_singleton_method(method) do |val|
          instance_variable_set("@#{method.to_s.sub('=', '')}", val)
        end
      else
        define_singleton_method(method) do
          instance_variable_get("@#{method}")
        end
      end
      send(method, *args, &block)
    end
1226109
def method_missing(method)
      method = method.to_s
      raise NoMethodError, "No such method: #{method}" unless @args.keys.include? method
      @args[method]
    end
177742
def raise_on_error(f):
    

    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        result = f(*args, **kwargs)
        retcode = GetLastError()
        if retcode and retcode != ERROR_IO_PENDING:
            err = WinError(code=retcode)
            windll.kernel32.SetLastError(0)  # clear error code so that we don't raise twice.
            raise err
        return result

    return wrapper
499523
def error(m)
      puts _word_wrap(m, '# ').red
      @targets.each { |_, t| t.error(m) }
    end
310096
def method_missing(method, *args)
      method = method.to_s
      method_class = method_as_class(method)
      options = args.last.is_a?(Hash) ? args.pop : {}

      FreshdeskAPI::Collection.new(self, method_class, options)
    end
713233
def method_missing msg, *args, &block
      defi = Definition.new(msg, args, block)
      if injected = __mock_injected[defi.msg]
        defi.original_method = injected.original_method
      else
        __mock_inject_method(defi)
      end
      __mock_defis_push(defi)
      Modifier.new(self, defi)
    end