빠른 참조

TomDoc 치트시트

Ruby를 위한 TomDoc 코드 문서화 표준 빠른 참조 가이드: 메서드 헤더, 인수 선언 및 가시성 태그 정리.

· 게시일

TomDoc은 명확하고 사람이 읽기 쉬운 코드 주석을 작성하기 위한 문서화 사양입니다.

메서드 헤더 예제 (Method Header)

# Public: Duplicate some text an arbitrary number of times.
#
# text  - The String to be duplicated.
# count - The Integer number of times to duplicate the text.
#
# Examples
#
#   multiplex('Tom', 4)
#   # => 'TomTomTomTom'
#
# Returns the duplicated String.
def multiplex(text, count)
  text * count
end

가시성 태그 (Visibility Tags)

  • Public: 외부 라이브러리 사용자가 사용할 수 있음.
  • Internal: 라이브러리 모듈 내부에서 사용되며 공용 API의 일부가 아님.
  • Deprecated: 향후 버전에서 제거될 예정임.

인수 및 옵션 (Arguments and Options)

# options - The Hash options used to refine selection (default: {}):
#           :color  - The String color to restrict by (optional).
#           :weight - The Float weight in grams (optional).

Yields 및 Return 문

# Yields the Integer index of the current iteration.
#
# Returns the duplicated String.
# Returns nothing.
# Raises Errno::ENOENT if the file cannot be located.

메서드 시그니처 (Method Signatures)

# Signature
#
#   find_by_<field>[_and_<field>...](args)

참고 자료

관련 주제