-
-
Notifications
You must be signed in to change notification settings - Fork 529
Fix typo in moviegoer #1781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typo in moviegoer #1781
Conversation
Hello. Thanks for opening a PR on Exercism 🙂 We ask that all changes to Exercism are discussed on our Community Forum before being opened on GitHub. To enforce this, we automatically close all PRs that are submitted. That doesn't mean your PR is rejected but that we want the initial discussion about it to happen on our forum where a wide range of key contributors across the Exercism ecosystem can weigh in. You can use this link to copy this into a new topic on the forum. If we decide the PR is appropriate, we'll reopen it and continue with it, so please don't delete your local branch. If you're interested in learning more about this auto-responder, please read this blog post. Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it. |
@@ -24,7 +24,7 @@ The cinema has a simplified age-verification system. | |||
If you are 18 or over you can watch scary movies. | |||
If you are younger, you cannot. | |||
|
|||
Implement the `Moviegoer.watch_scary_movie?` method. | |||
Implement the `Moviegoer#watch_scary_movie?` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a typographical error, it is as intended. The method called is an instance method, as we can see and verify from the tests:
def test_regular_ticket_price
assert_equal 15, Moviegoer.new(59).ticket_price
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it was originally documented within exercises/concept/moviegoer/moviegoer.rb, I believe “Moviegoer#watch_scary_movie” is correct. What do you think?
def watch_scary_movie?
raise 'Please implement the Moviegoer#watch_scary_movie method'
end
Additionally, instance methods of the same format are also written using “#” in the problem statement.
Therefore, I thought it would be better to standardize the notation for instance methods.
Write the
Moviegoer#ticket_price
method using a ternary statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know for a fact that it is correct. Class#method_name
is for instance methods and Class.method_name
, as well as the less used Class::method_name
is for class methods. The first example is not usable invocable code, but is how we have documented Ruby code since well before 1.8.5.
@@ -6,7 +6,7 @@ | |||
|
|||
## 2. Check if a moviegoer is allowed to see scary movies | |||
|
|||
- [Compare][doc-integer-gtoe] the moviegoer's age with the minimum age allowed to see scary movies. You don't even need thee ternary operator in this task. | |||
- [Compare][doc-integer-gtoe] the moviegoer's age with the minimum age allowed to see scary movies. You don't even need the ternary operator in this task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is good.
Sorry for the noise, we are saying the same thing, I am being round-about with it, and did not realize it. |
@kotp |
Typos in the Moviegoer documentation file have been corrected.
Please review.
Reference: