مرجع سريع

ورقة غش TomDoc

دليل مرجعي سريع لمعيار توثيق أكواد TomDoc للغة Ruby، يغطي ترويسات الدوال وتصريحات الوسائط والوسوم.

· تاريخ النشر

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: يُستخدم داخلياً عبر وحدات المكتبة؛ وليس جزءاً من واجهة برمجة التطبيقات العامة.
  • 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 and Return Statements)

# 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)

المراجع

موضوعات ذات صلة