Skip to content
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

Correct code to be Rubocop compliant #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RupertSaxton
Copy link

No description provided.

gem_city.rb Outdated
@people = {
thieves: 5,
officers: 1
}
Copy link
Member

Choose a reason for hiding this comment

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

Do these two values really need to be joined into Hash? Consider the simplification if they weren't.

Copy link
Author

Choose a reason for hiding this comment

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

I had used it because that's the way it came but having them as instance variables and using attr_accessor is much nicer

gem_city.rb Outdated
@population = 50
end

def thieves(thieves_number = @people[:thieves])
Copy link
Member

Choose a reason for hiding this comment

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

Officers have both a getter and setter method, but thieves just have this hybrid method. I think two methods is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants