Skip to content

Macro not useable on class methods #632

@schmurfy

Description

@schmurfy

I searched the documentation and the issues and, I cannot exclude the error is on me sorry if it is !

While trying to use macro to remove duplication in my sources I tried this:

module M
  module_function

  ##    
  # @!macro [new] svc
  #   @param [Peer]   peer          client object
  #   @param [String] session_id    session ID


  ##
  # it does something.
  # 
  # @!macro svc
  # @param [String] str A string
  # 
  # @return [String] another string
  def do_something(peer, session_id, str)

  end

end

My problem is that when you generate the documentation for this file the macro body will not get included into the "do_something" method documentation, but if you remove the module_function call everything works ax expected.

Same behavior is shown when using the "self.do_something" syntax to declare the class method so this is consistent and that is why I am not sure I did it right.

Ps: It would be nice if there was some kind of error raised when trying to use a macro which is not defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions