Το 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)