Recall & Review
beginner
What is YARD in Ruby?
YARD is a tool for writing and generating documentation for Ruby code. It helps you create clear, organized docs from special comments in your code.
Click to reveal answer
beginner
How do you write a basic YARD comment for a method?
You write a comment starting with # before the method, using tags like @param for parameters and @return for the return value.
Click to reveal answer
beginner
What does the @param tag do in YARD?
The @param tag describes a method parameter. It shows the parameter name, type, and a short explanation.
Click to reveal answer
beginner
How do you generate HTML documentation using YARD?
Run the command yard doc in your terminal. It creates HTML files you can open in a browser to read your docs.
Click to reveal answer
beginner
Why is documenting code with YARD helpful?
It makes your code easier to understand for others and yourself later. It also helps tools and editors show useful info about your code.
Click to reveal answer
What symbol starts a YARD comment in Ruby?
✗ Incorrect
YARD comments in Ruby start with the # symbol, just like regular Ruby comments.
Which YARD tag describes a method's return value?
✗ Incorrect
The @return tag explains what a method returns.
How do you generate documentation files with YARD?
✗ Incorrect
The command yard doc creates the documentation files.
What is the main purpose of YARD?
✗ Incorrect
YARD is used to write and generate documentation for Ruby code.
Which tag would you use to describe a method parameter's type?
✗ Incorrect
The @param tag includes the parameter name and type.
Explain how to write a YARD comment for a method that takes two parameters and returns a value.
Think about describing inputs and outputs clearly.
You got /4 concepts.
Describe the steps to generate and view documentation using YARD.
Focus on the process from code to readable docs.
You got /3 concepts.