이번에는 변경자 중에 아래와 같은 것들을 사용해 보고자 한다.

:yield:

:nodoc: [all]

:doc:

:notnew:

class TestRDoc2
  def fred
    line = 'Line'
    address = 'Address'

    yield line, address
  end

  def fred2             # :yields: index, position
    line = 'Line'
    address = 'Address'

    yield line, address
  end

  private
  def private_fred
    puts '.'
  end

  # Add private method to RDoc
  def private_fred_2  # :doc:
    puts '..'
  end
end

module SM         #:nodoc:
  class Input
  end
end

module Markup     #:nodoc: all
  class Output
  end
end

 

소스 창을 띄워놓고 보기 : http://codepad.org/6lJZfdC7

위의 코드가 만들어내는 RDoc 는 다음과 같다.

 

 


크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by Heart
TAG ,