Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/concept/moviegoer/.docs/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is good.


## 3. Check if a moviegoer is entitled to free popcorn

Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/moviegoer/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

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

Copy link
Contributor Author

@lemonade-37 lemonade-37 Sep 1, 2025

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.

Copy link
Member

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.

It should return whether someone is allowed to watch the movie or not.

```ruby
Expand Down